1#ifndef INFINI_OPS_BASE_MSE_LOSS_H_
2#define INFINI_OPS_BASE_MSE_LOSS_H_
8#include "common/op_utils/reduction.h"
16 const std::optional<Tensor> weight,
17 const std::optional<bool> size_average,
18 const std::optional<bool> reduce,
const std::string reduction,
29 reduction_{reduction_detail::FromPythonArguments(size_average, reduce,
32 assert(!weight.has_value() &&
33 "`weight` is unsupported because the current ATen `MseLoss` ABI "
34 "cannot implement the Python wrapper's weighted composition");
39 [[deprecated(
"Use the PyTorch-compatible overload instead.")]]
55 const std::optional<Tensor> weight,
56 const std::optional<bool> size_average,
57 const std::optional<bool> reduce,
const std::string reduction,
59 assert(!weight.has_value() &&
60 "`weight` is unsupported because the current ATen `MseLoss` ABI "
61 "cannot implement the Python wrapper's weighted composition");
65 reduction_detail::FromPythonArguments(size_average, reduce, reduction),
71 [[deprecated(
"Use the PyTorch-compatible overload instead.")]]
73 const int64_t reduction,
Tensor out)
const = 0;
Tensor::Shape target_shape_
Definition mse_loss.h:82
Tensor::Strides out_strides_
Definition mse_loss.h:90
MseLoss(const Tensor input, const Tensor target, const int64_t reduction, Tensor out)
Definition mse_loss.h:40
Tensor::Strides input_strides_
Definition mse_loss.h:78
DataType target_type_
Definition mse_loss.h:86
int64_t reduction_
Definition mse_loss.h:94
Tensor::Strides target_strides_
Definition mse_loss.h:84
MseLoss(const Tensor input, const Tensor target, const std::optional< Tensor > weight, const std::optional< bool > size_average, const std::optional< bool > reduce, const std::string reduction, Tensor out)
Definition mse_loss.h:15
DataType out_type_
Definition mse_loss.h:92
Tensor::Shape input_shape_
Definition mse_loss.h:76
Tensor::Shape out_shape_
Definition mse_loss.h:88
void operator()(const Tensor input, const Tensor target, const std::optional< Tensor > weight, const std::optional< bool > size_average, const std::optional< bool > reduce, const std::string reduction, Tensor out) const
Definition mse_loss.h:54
DataType input_type_
Definition mse_loss.h:80
int device_index_
Definition mse_loss.h:96
virtual void operator()(const Tensor input, const Tensor target, const int64_t reduction, Tensor out) const =0
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8