1#ifndef INFINI_OPS_BASE_SOFT_MARGIN_LOSS_H_
2#define INFINI_OPS_BASE_SOFT_MARGIN_LOSS_H_
7#include "common/op_utils/reduction.h"
15 const std::optional<bool> size_average,
16 const std::optional<bool> reduce,
const std::string reduction,
27 reduction_{reduction_detail::FromPythonArguments(size_average, reduce,
33 [[deprecated(
"Use the Python-compatible reduction overload instead.")]]
35 const int64_t reduction,
Tensor out)
49 const std::optional<bool> size_average,
50 const std::optional<bool> reduce,
const std::string reduction,
54 reduction_detail::FromPythonArguments(size_average, reduce, reduction),
60 [[deprecated(
"Use the Python-compatible reduction overload instead.")]]
62 const int64_t reduction,
Tensor out)
const = 0;
Definition generated/include/operator.h:282
Definition soft_margin_loss.h:12
Tensor::Shape input_shape_
Definition soft_margin_loss.h:65
Tensor::Strides target_strides_
Definition soft_margin_loss.h:73
DataType input_type_
Definition soft_margin_loss.h:69
SoftMarginLoss(const Tensor input, const Tensor target, const int64_t reduction, Tensor out)
Definition soft_margin_loss.h:34
DataType out_type_
Definition soft_margin_loss.h:81
Tensor::Strides input_strides_
Definition soft_margin_loss.h:67
Tensor::Shape out_shape_
Definition soft_margin_loss.h:77
void operator()(const Tensor input, const Tensor target, const std::optional< bool > size_average, const std::optional< bool > reduce, const std::string reduction, Tensor out) const
Definition soft_margin_loss.h:48
SoftMarginLoss(const Tensor input, const Tensor target, const std::optional< bool > size_average, const std::optional< bool > reduce, const std::string reduction, Tensor out)
Definition soft_margin_loss.h:14
DataType target_type_
Definition soft_margin_loss.h:75
virtual void operator()(const Tensor input, const Tensor target, const int64_t reduction, Tensor out) const =0
Tensor::Strides out_strides_
Definition soft_margin_loss.h:79
int device_index_
Definition soft_margin_loss.h:85
Tensor::Shape target_shape_
Definition soft_margin_loss.h:71
int64_t reduction_
Definition soft_margin_loss.h:83
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8