Rate this Page

Template Class BatchLambda#

Inheritance Relationships#

Base Type#

Class Documentation#

template<typename Input, typename Output = Input>
class BatchLambda : public torch::data::transforms::BatchTransform<Input, Input>#

A BatchTransform that applies a user-provided functor to a batch.

Public Types

using FunctionType = std::function<OutputBatchType(InputBatchType)>#

Public Functions

inline explicit BatchLambda(FunctionType function)#

Constructs the BatchLambda from the given function object.

inline virtual OutputBatchType apply_batch(InputBatchType input_batch) override#

Applies the user-provided function object to the input_batch.