1#ifndef INFINI_OPS_BASE_HUBER_LOSS_H_
2#define INFINI_OPS_BASE_HUBER_LOSS_H_
8#include "common/op_utils/reduction.h"
16 const std::optional<Tensor> weight,
const std::string reduction,
17 const double delta,
Tensor out)
27 reduction_{reduction_detail::FromString(reduction)},
30 assert(!weight.has_value() &&
31 "The current ATen Huber loss ABI does not support `weight`; pass "
37 [[deprecated(
"Use the Python-compatible constructor instead.")]]
39 const double delta,
Tensor out)
54 const std::optional<Tensor> weight,
55 const std::string reduction,
const double delta,
57 assert(!weight.has_value() &&
58 "The current ATen Huber loss ABI does not support `weight`; pass "
60 (*this)(input, target, reduction_detail::FromString(reduction), delta, out);
65 [[deprecated(
"Use the Python-compatible call overload instead.")]]
67 const int64_t reduction,
const double delta,
Definition huber_loss.h:13
Tensor::Shape out_shape_
Definition huber_loss.h:83
void operator()(const Tensor input, const Tensor target, const std::optional< Tensor > weight, const std::string reduction, const double delta, Tensor out) const
Definition huber_loss.h:53
Tensor::Shape input_shape_
Definition huber_loss.h:71
DataType input_type_
Definition huber_loss.h:75
int64_t reduction_
Definition huber_loss.h:89
DataType out_type_
Definition huber_loss.h:87
int device_index_
Definition huber_loss.h:93
HuberLoss(const Tensor input, const Tensor target, const std::optional< Tensor > weight, const std::string reduction, const double delta, Tensor out)
Definition huber_loss.h:15
Tensor::Strides target_strides_
Definition huber_loss.h:79
double delta_
Definition huber_loss.h:91
virtual void operator()(const Tensor input, const Tensor target, const int64_t reduction, const double delta, Tensor out) const =0
HuberLoss(const Tensor input, const Tensor target, const int64_t reduction, const double delta, Tensor out)
Definition huber_loss.h:38
Tensor::Strides out_strides_
Definition huber_loss.h:85
DataType target_type_
Definition huber_loss.h:81
Tensor::Shape target_shape_
Definition huber_loss.h:77
Tensor::Strides input_strides_
Definition huber_loss.h:73
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8