1#ifndef INFINI_OPS_BASE_NLL_LOSS2D_BACKWARD_H_
2#define INFINI_OPS_BASE_NLL_LOSS2D_BACKWARD_H_
13 const Tensor target,
const std::optional<Tensor> weight,
14 const Tensor total_weight,
const int64_t reduction,
15 const int64_t ignore_index,
Tensor grad_input)
36 weight_type_{weight ? weight->dtype() : DataType::kFloat32},
43 const std::optional<Tensor> weight,
44 const Tensor total_weight,
const int64_t reduction,
45 const int64_t ignore_index,
46 Tensor grad_input)
const = 0;
Definition nll_loss2d_backward.h:10
Tensor::Strides total_weight_strides_
Definition nll_loss2d_backward.h:69
DataType weight_type_
Definition nll_loss2d_backward.h:85
Tensor::Strides grad_input_strides_
Definition nll_loss2d_backward.h:75
NllLoss2dBackward(const Tensor grad_output, const Tensor input, const Tensor target, const std::optional< Tensor > weight, const Tensor total_weight, const int64_t reduction, const int64_t ignore_index, Tensor grad_input)
Definition nll_loss2d_backward.h:12
Tensor::Strides target_strides_
Definition nll_loss2d_backward.h:63
virtual void operator()(const Tensor grad_output, const Tensor input, const Tensor target, const std::optional< Tensor > weight, const Tensor total_weight, const int64_t reduction, const int64_t ignore_index, Tensor grad_input) const =0
Tensor::Strides input_strides_
Definition nll_loss2d_backward.h:57
int device_index_
Definition nll_loss2d_backward.h:91
int64_t reduction_
Definition nll_loss2d_backward.h:87
Tensor::Shape total_weight_shape_
Definition nll_loss2d_backward.h:67
DataType target_type_
Definition nll_loss2d_backward.h:65
DataType total_weight_type_
Definition nll_loss2d_backward.h:71
bool has_weight_
Definition nll_loss2d_backward.h:79
Tensor::Strides grad_output_strides_
Definition nll_loss2d_backward.h:51
DataType grad_output_type_
Definition nll_loss2d_backward.h:53
Tensor::Shape weight_shape_
Definition nll_loss2d_backward.h:81
Tensor::Shape target_shape_
Definition nll_loss2d_backward.h:61
int64_t ignore_index_
Definition nll_loss2d_backward.h:89
DataType grad_input_type_
Definition nll_loss2d_backward.h:77
Tensor::Strides weight_strides_
Definition nll_loss2d_backward.h:83
Tensor::Shape grad_output_shape_
Definition nll_loss2d_backward.h:49
Tensor::Shape input_shape_
Definition nll_loss2d_backward.h:55
DataType input_type_
Definition nll_loss2d_backward.h:59
Tensor::Shape grad_input_shape_
Definition nll_loss2d_backward.h:73
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8