3 #include <torch/types.h> 10 namespace transforms {
13 template <
typename InputBatch,
typename OutputBatch>
16 using InputBatchType = InputBatch;
17 using OutputBatchType = OutputBatch;
22 virtual OutputBatch
apply_batch(InputBatch input_batch) = 0;
31 template <
typename Input,
typename Output>
35 using InputType = Input;
42 std::vector<Output>
apply_batch(std::vector<Input> input_batch)
override {
43 std::vector<Output> output_batch;
44 output_batch.reserve(input_batch.size());
45 for (
auto&& input : input_batch) {
46 output_batch.push_back(apply(std::move(input)));