|
| 1 | +// AUTO-GENERATED by `scripts/generate_torch_ops.py` — DO NOT EDIT. |
| 2 | +#ifndef INFINI_OPS_BASE_GLU_BACKWARD_H_ |
| 3 | +#define INFINI_OPS_BASE_GLU_BACKWARD_H_ |
| 4 | + |
| 5 | +#include "operator.h" |
| 6 | + |
| 7 | +namespace infini::ops { |
| 8 | + |
| 9 | +class GluBackward : public Operator<GluBackward> { |
| 10 | + public: |
| 11 | + GluBackward(const Tensor grad_output, const Tensor input, const int64_t dim, Tensor grad_input) |
| 12 | + : grad_output_shape_{grad_output.shape()}, |
| 13 | + grad_output_strides_{grad_output.strides()}, |
| 14 | + grad_output_type_{grad_output.dtype()}, |
| 15 | + input_shape_{input.shape()}, |
| 16 | + input_strides_{input.strides()}, |
| 17 | + input_type_{input.dtype()}, |
| 18 | + grad_input_shape_{grad_input.shape()}, |
| 19 | + grad_input_strides_{grad_input.strides()}, |
| 20 | + grad_input_type_{grad_input.dtype()}, |
| 21 | + dim_{dim}, |
| 22 | + device_index_{grad_input.device().index()} {} |
| 23 | + |
| 24 | + virtual void operator()(const Tensor grad_output, const Tensor input, const int64_t dim, Tensor grad_input) const = 0; |
| 25 | + |
| 26 | + protected: |
| 27 | + Tensor::Shape grad_output_shape_; |
| 28 | + |
| 29 | + Tensor::Strides grad_output_strides_; |
| 30 | + |
| 31 | + DataType grad_output_type_; |
| 32 | + |
| 33 | + Tensor::Shape input_shape_; |
| 34 | + |
| 35 | + Tensor::Strides input_strides_; |
| 36 | + |
| 37 | + DataType input_type_; |
| 38 | + |
| 39 | + Tensor::Shape grad_input_shape_; |
| 40 | + |
| 41 | + Tensor::Strides grad_input_strides_; |
| 42 | + |
| 43 | + DataType grad_input_type_; |
| 44 | + |
| 45 | + int64_t dim_{}; |
| 46 | + |
| 47 | + int device_index_{0}; |
| 48 | +}; |
| 49 | + |
| 50 | +} // namespace infini::ops |
| 51 | + |
| 52 | +#endif |
0 commit comments