InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
matrix_power.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_MATRIX_POWER_H_
2#define INFINI_OPS_BASE_MATRIX_POWER_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class MatrixPower : public Operator<MatrixPower> {
9 public:
10 MatrixPower(const Tensor input, const int64_t n, Tensor out)
11 : input_shape_{input.shape()},
12 input_strides_{input.strides()},
13 input_type_{input.dtype()},
14 out_shape_{out.shape()},
15 out_strides_{out.strides()},
16 out_type_{out.dtype()},
17 n_{n},
18 device_index_{out.device().index()} {}
19
20 virtual void operator()(const Tensor input, const int64_t n,
21 Tensor out) const = 0;
22
23 protected:
24 Tensor::Shape input_shape_;
25
26 Tensor::Strides input_strides_;
27
28 DataType input_type_;
29
30 Tensor::Shape out_shape_;
31
32 Tensor::Strides out_strides_;
33
34 DataType out_type_;
35
36 int64_t n_{};
37
39};
40
41} // namespace infini::ops
42
43#endif
Definition matrix_power.h:8
MatrixPower(const Tensor input, const int64_t n, Tensor out)
Definition matrix_power.h:10
Tensor::Strides input_strides_
Definition matrix_power.h:26
Tensor::Strides out_strides_
Definition matrix_power.h:32
Tensor::Shape input_shape_
Definition matrix_power.h:24
DataType input_type_
Definition matrix_power.h:28
virtual void operator()(const Tensor input, const int64_t n, Tensor out) const =0
Tensor::Shape out_shape_
Definition matrix_power.h:30
int device_index_
Definition matrix_power.h:38
int64_t n_
Definition matrix_power.h:36
DataType out_type_
Definition matrix_power.h:34
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8