From 3d11d138bd885ab40f7b714c04d32e182cf482f5 Mon Sep 17 00:00:00 2001 From: Jiacheng Huang Date: Wed, 13 May 2026 14:34:47 +0800 Subject: [PATCH 1/2] feat: add `deg2rad` base --- src/base/deg2rad.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/base/deg2rad.h diff --git a/src/base/deg2rad.h b/src/base/deg2rad.h new file mode 100644 index 000000000..d3ae05801 --- /dev/null +++ b/src/base/deg2rad.h @@ -0,0 +1,39 @@ +#ifndef INFINI_OPS_BASE_DEG2RAD_H_ +#define INFINI_OPS_BASE_DEG2RAD_H_ + +#include "operator.h" + +namespace infini::ops { + +class Deg2rad : public Operator { + public: + Deg2rad(const Tensor input, Tensor out) + : input_shape_{input.shape()}, + input_strides_{input.strides()}, + input_type_{input.dtype()}, + out_shape_{out.shape()}, + out_strides_{out.strides()}, + out_type_{out.dtype()}, + device_index_{out.device().index()} {} + + virtual void operator()(const Tensor input, Tensor out) const = 0; + + protected: + Tensor::Shape input_shape_; + + Tensor::Strides input_strides_; + + DataType input_type_; + + Tensor::Shape out_shape_; + + Tensor::Strides out_strides_; + + DataType out_type_; + + int device_index_{0}; +}; + +} // namespace infini::ops + +#endif \ No newline at end of file From e2806ca9fff5032c197b08bdd8ce9118cbe147ee Mon Sep 17 00:00:00 2001 From: Jiacheng Huang Date: Mon, 18 May 2026 19:56:51 +0800 Subject: [PATCH 2/2] fix: add trailing newline to base header --- src/base/deg2rad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/deg2rad.h b/src/base/deg2rad.h index d3ae05801..90792e819 100644 --- a/src/base/deg2rad.h +++ b/src/base/deg2rad.h @@ -36,4 +36,4 @@ class Deg2rad : public Operator { } // namespace infini::ops -#endif \ No newline at end of file +#endif