Transform — Torchvision 0.22 documentation (original) (raw)
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
:
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.