#pragma once #include #include #include #include #include #include #include #include namespace torch { namespace nn { /// Creates a criterion that measures the mean absolute error (MAE) between each /// element in the input : math :`x` and target : `y`. struct TORCH_API L1LossImpl : Module { explicit L1LossImpl(const L1LossOptions& options_ = {}); /// Pretty prints the `L1Loss` module into the given `stream`. void pretty_print(std::ostream& stream) const override; Tensor forward(const Tensor& input, const Tensor& target); /// The options with which this `Module` was constructed. L1LossOptions options; }; /// A `ModuleHolder` subclass for `L1LossImpl`. /// See the documentation for `L1LossImpl` class to learn what methods it /// provides, or the documentation for `ModuleHolder` to learn about PyTorch's /// module storage semantics. TORCH_MODULE(L1Loss); } // namespace nn } // namespace torch