Template Struct Normalize

Inheritance Relationships

Base Type

Struct Documentation

template<typename Target = Tensor>
struct torch::data::transforms::Normalize : public torch::data::transforms::TensorTransform<Target>

Normalizes input tensors by subtracting the supplied mean and dividing by the given standard deviation.

Public Functions

Normalize(ArrayRef<double> mean, ArrayRef<double> stddev)

Constructs a Normalize transform.

The mean and standard deviation can be anything that is broadcastable over the input tensors (like single scalars).

torch::Tensor operator()(Tensor input) override

Transforms a single input tensor to an output tensor.

Public Members

torch::Tensor mean
torch::Tensor stddev


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources