Shortcuts

TVTensor

class torchvision.tv_tensors.TVTensor[source]

[Beta] Base class for all TVTensors.

You probably don’t want to use this class unless you’re defining your own custom TVTensors. See How to write your own TVTensor class for details.

property device: device

Is the torch.device where this Tensor is.

property ndim: int

Alias for dim()

property shape: Union[Size, List[int], Tuple[int, ...]]

Returns the size of the self tensor. Alias for size.

See also Tensor.size().

Example:

>>> t = torch.empty(3, 4, 5)
>>> t.size()
torch.Size([3, 4, 5])
>>> t.shape
torch.Size([3, 4, 5])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources