Skip to content

Commit 21b90bf

Browse files
committed
feat: add multilabel_margin_loss_forward base
1 parent 78424f7 commit 21b90bf

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// AUTO-GENERATED by `scripts/generate_torch_ops.py` — DO NOT EDIT.
2+
#ifndef INFINI_OPS_BASE_MULTILABEL_MARGIN_LOSS_FORWARD_H_
3+
#define INFINI_OPS_BASE_MULTILABEL_MARGIN_LOSS_FORWARD_H_
4+
5+
#include "operator.h"
6+
7+
namespace infini::ops {
8+
9+
class MultilabelMarginLossForward : public Operator<MultilabelMarginLossForward> {
10+
public:
11+
MultilabelMarginLossForward(const Tensor input, const Tensor target, const int64_t reduction, Tensor output, Tensor is_target)
12+
: input_shape_{input.shape()},
13+
input_strides_{input.strides()},
14+
input_type_{input.dtype()},
15+
target_shape_{target.shape()},
16+
target_strides_{target.strides()},
17+
target_type_{target.dtype()},
18+
output_shape_{output.shape()},
19+
output_strides_{output.strides()},
20+
output_type_{output.dtype()},
21+
is_target_shape_{is_target.shape()},
22+
is_target_strides_{is_target.strides()},
23+
is_target_type_{is_target.dtype()},
24+
reduction_{reduction},
25+
device_index_{output.device().index()} {}
26+
27+
virtual void operator()(const Tensor input, const Tensor target, const int64_t reduction, Tensor output, Tensor is_target) const = 0;
28+
29+
protected:
30+
Tensor::Shape input_shape_;
31+
32+
Tensor::Strides input_strides_;
33+
34+
DataType input_type_;
35+
36+
Tensor::Shape target_shape_;
37+
38+
Tensor::Strides target_strides_;
39+
40+
DataType target_type_;
41+
42+
Tensor::Shape output_shape_;
43+
44+
Tensor::Strides output_strides_;
45+
46+
DataType output_type_;
47+
48+
Tensor::Shape is_target_shape_;
49+
50+
Tensor::Strides is_target_strides_;
51+
52+
DataType is_target_type_;
53+
54+
int64_t reduction_{};
55+
56+
int device_index_{0};
57+
};
58+
59+
} // namespace infini::ops
60+
61+
#endif

0 commit comments

Comments
 (0)