Shortcuts

Template Class BatchLambda

Inheritance Relationships

Base Type

Class Documentation

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

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

Public Types

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

Public Functions

BatchLambda(FunctionType function)

Constructs the BatchLambda from the given function object.

OutputBatchType apply_batch(InputBatchType input_batch) override

Applies the user-provided function object to the input_batch.

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