Shortcuts

Template Class Transform

Inheritance Relationships

Base Type

Class Documentation

template<typename Input, typename Output>
class Transform : public torch::data::transforms::BatchTransform<std::vector<Input>, std::vector<Output>>

A transformation of individual input examples to individual output examples.

Just like a Dataset is a BatchDataset, a Transform is a BatchTransform that can operate on the level of individual examples rather than entire batches. The batch-level transform is implemented (by default) in terms of the example-level transform, though this can be customized.

Public Types

using InputType = Input
using OutputType = Output

Public Functions

virtual OutputType apply(InputType input) = 0

Applies the transformation to the given input.

inline virtual std::vector<Output> apply_batch(std::vector<Input> input_batch) override

Applies the transformation over the entire input_batch.

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