Shortcuts

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.

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