Template Class TensorLambda

Inheritance Relationships

Base Type

Class Documentation

template<typename Target = Tensor>
class torch::data::transforms::TensorLambda : public torch::data::transforms::TensorTransform<Target>

A Lambda specialized for the typical Example<Tensor, Tensor> input type.

Public Types

using FunctionType = std::function<Tensor(Tensor)>

Public Functions

TensorLambda(FunctionType function)

Creates a TensorLambda from the given function.

Tensor operator()(Tensor input) override

Applies the user-provided functor to the input tensor.


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