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