Rate this Page

Template Class TensorLambda#

Inheritance Relationships#

Base Type#

Class Documentation#

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

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

Public Types

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

Public Functions

inline explicit TensorLambda(FunctionType function)#

Creates a TensorLambda from the given function.

inline virtual Tensor operator()(Tensor input) override#

Applies the user-provided functor to the input tensor.