Shortcuts

TVTensor

class torchvision.tv_tensors.TVTensor[source]

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.

Examples using TVTensor:

Getting started with transforms v2

Getting started with transforms v2

Transforms v2: End-to-end object detection/segmentation example

Transforms v2: End-to-end object detection/segmentation example

How to write your own v2 transforms

How to write your own v2 transforms

TVTensors FAQ

TVTensors FAQ

How to write your own TVTensor class

How to write your own TVTensor class
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