InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
special_chebyshev_polynomial_t.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_SPECIAL_CHEBYSHEV_POLYNOMIAL_T_H_
2#define INFINI_OPS_BASE_SPECIAL_CHEBYSHEV_POLYNOMIAL_T_H_
3
4#include "operator.h"
5
6namespace infini::ops::special {
7
8class ChebyshevPolynomialT : public Operator<ChebyshevPolynomialT> {
9 public:
11 : x_shape_{x.shape()},
12 x_strides_{x.strides()},
13 x_type_{x.dtype()},
14 n_shape_{n.shape()},
15 n_strides_{n.strides()},
16 n_type_{n.dtype()},
17 out_shape_{out.shape()},
18 out_strides_{out.strides()},
19 out_type_{out.dtype()},
20 device_index_{out.device().index()} {}
21
22 ChebyshevPolynomialT(const Tensor x, const double n, Tensor out)
23 : x_shape_{x.shape()},
24 x_strides_{x.strides()},
25 x_type_{x.dtype()},
26 out_shape_{out.shape()},
27 out_strides_{out.strides()},
28 out_type_{out.dtype()},
29 n_{n},
30 device_index_{out.device().index()} {}
31
32 virtual void operator()(const Tensor x, const Tensor n, Tensor out) const = 0;
33
34 virtual void operator()(const Tensor x, const double n, Tensor out) const = 0;
35
36 protected:
37 Tensor::Shape x_shape_;
38
39 Tensor::Strides x_strides_;
40
41 DataType x_type_;
42
43 Tensor::Shape n_shape_;
44
45 Tensor::Strides n_strides_;
46
47 DataType n_type_;
48
49 Tensor::Shape out_shape_;
50
51 Tensor::Strides out_strides_;
52
53 DataType out_type_;
54
55 double n_{};
56
58};
59
60} // namespace infini::ops::special
61
62#endif
Definition generated/include/operator.h:282
Definition special_chebyshev_polynomial_t.h:8
Tensor::Shape out_shape_
Definition special_chebyshev_polynomial_t.h:49
DataType out_type_
Definition special_chebyshev_polynomial_t.h:53
ChebyshevPolynomialT(const Tensor x, const double n, Tensor out)
Definition special_chebyshev_polynomial_t.h:22
Tensor::Shape n_shape_
Definition special_chebyshev_polynomial_t.h:43
double n_
Definition special_chebyshev_polynomial_t.h:55
Tensor::Strides n_strides_
Definition special_chebyshev_polynomial_t.h:45
Tensor::Strides out_strides_
Definition special_chebyshev_polynomial_t.h:51
Tensor::Strides x_strides_
Definition special_chebyshev_polynomial_t.h:39
virtual void operator()(const Tensor x, const double n, Tensor out) const =0
int device_index_
Definition special_chebyshev_polynomial_t.h:57
DataType n_type_
Definition special_chebyshev_polynomial_t.h:47
ChebyshevPolynomialT(const Tensor x, const Tensor n, Tensor out)
Definition special_chebyshev_polynomial_t.h:10
DataType x_type_
Definition special_chebyshev_polynomial_t.h:41
virtual void operator()(const Tensor x, const Tensor n, Tensor out) const =0
Tensor::Shape x_shape_
Definition special_chebyshev_polynomial_t.h:37
Definition special_airy_ai.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8