InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
special_legendre_polynomial_p.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_SPECIAL_LEGENDRE_POLYNOMIAL_P_H_
2#define INFINI_OPS_BASE_SPECIAL_LEGENDRE_POLYNOMIAL_P_H_
3
4#include "operator.h"
5
6namespace infini::ops::special {
7
8class LegendrePolynomialP : public Operator<LegendrePolynomialP> {
9 public:
10 LegendrePolynomialP(const Tensor x, const Tensor n, Tensor out)
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 LegendrePolynomialP(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_legendre_polynomial_p.h:8
int device_index_
Definition special_legendre_polynomial_p.h:57
Tensor::Strides out_strides_
Definition special_legendre_polynomial_p.h:51
DataType x_type_
Definition special_legendre_polynomial_p.h:41
Tensor::Shape x_shape_
Definition special_legendre_polynomial_p.h:37
LegendrePolynomialP(const Tensor x, const double n, Tensor out)
Definition special_legendre_polynomial_p.h:22
double n_
Definition special_legendre_polynomial_p.h:55
DataType n_type_
Definition special_legendre_polynomial_p.h:47
LegendrePolynomialP(const Tensor x, const Tensor n, Tensor out)
Definition special_legendre_polynomial_p.h:10
Tensor::Shape n_shape_
Definition special_legendre_polynomial_p.h:43
Tensor::Strides n_strides_
Definition special_legendre_polynomial_p.h:45
virtual void operator()(const Tensor x, const Tensor n, Tensor out) const =0
Tensor::Shape out_shape_
Definition special_legendre_polynomial_p.h:49
Tensor::Strides x_strides_
Definition special_legendre_polynomial_p.h:39
DataType out_type_
Definition special_legendre_polynomial_p.h:53
virtual void operator()(const Tensor x, const double n, Tensor out) const =0
Definition special_airy_ai.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8