Shortcuts

Transform

class torchvision.transforms.v2.Transform[source]

Base class to implement your own v2 transforms.

See How to write your own v2 transforms for more details.

Examples using Transform:

Getting started with transforms v2

Getting started with transforms v2

Illustration of transforms

Illustration of transforms

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

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

How to use CutMix and MixUp

How to use CutMix and MixUp

How to write your own v2 transforms

How to write your own v2 transforms

How to write your own TVTensor class

How to write your own TVTensor class
extra_repr() str[source]

Return the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

forward(*inputs: Any) Any[source]

Do not override this! Use transform() instead.

make_params(flat_inputs: List[Any]) Dict[str, Any][source]

Method to override for custom transforms.

See How to write your own v2 transforms

transform(inpt: Any, params: Dict[str, Any]) Any[source]

Method to override for custom transforms.

See How to write your own v2 transforms

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