InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
internal_convert_indices_from_csr_to_coo.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_INTERNAL_CONVERT_INDICES_FROM_CSR_TO_COO_H_
2#define INFINI_OPS_BASE_INTERNAL_CONVERT_INDICES_FROM_CSR_TO_COO_H_
3
4#include "operator.h"
5
6namespace infini::ops::internal {
7
8class ConvertIndicesFromCsrToCoo : public Operator<ConvertIndicesFromCsrToCoo> {
9 public:
11 const Tensor col_indices, const bool out_int32,
12 const bool transpose, Tensor out)
13 : crow_indices_shape_{crow_indices.shape()},
14 crow_indices_strides_{crow_indices.strides()},
15 crow_indices_type_{crow_indices.dtype()},
16 col_indices_shape_{col_indices.shape()},
17 col_indices_strides_{col_indices.strides()},
18 col_indices_type_{col_indices.dtype()},
19 out_shape_{out.shape()},
20 out_strides_{out.strides()},
21 out_type_{out.dtype()},
22 out_int32_{out_int32},
23 transpose_{transpose},
24 device_index_{out.device().index()} {}
25
26 virtual void operator()(const Tensor crow_indices, const Tensor col_indices,
27 const bool out_int32, const bool transpose,
28 Tensor out) const = 0;
29
30 protected:
31 Tensor::Shape crow_indices_shape_;
32
33 Tensor::Strides crow_indices_strides_;
34
36
37 Tensor::Shape col_indices_shape_;
38
39 Tensor::Strides col_indices_strides_;
40
42
43 Tensor::Shape out_shape_;
44
45 Tensor::Strides out_strides_;
46
47 DataType out_type_;
48
49 bool out_int32_{};
50
51 bool transpose_{};
52
54};
55
56} // namespace infini::ops::internal
57
58#endif
Definition generated/include/operator.h:282
Definition internal_convert_indices_from_csr_to_coo.h:8
DataType out_type_
Definition internal_convert_indices_from_csr_to_coo.h:47
ConvertIndicesFromCsrToCoo(const Tensor crow_indices, const Tensor col_indices, const bool out_int32, const bool transpose, Tensor out)
Definition internal_convert_indices_from_csr_to_coo.h:10
Tensor::Strides crow_indices_strides_
Definition internal_convert_indices_from_csr_to_coo.h:33
Tensor::Strides out_strides_
Definition internal_convert_indices_from_csr_to_coo.h:45
Tensor::Shape out_shape_
Definition internal_convert_indices_from_csr_to_coo.h:43
DataType col_indices_type_
Definition internal_convert_indices_from_csr_to_coo.h:41
bool transpose_
Definition internal_convert_indices_from_csr_to_coo.h:51
Tensor::Shape col_indices_shape_
Definition internal_convert_indices_from_csr_to_coo.h:37
Tensor::Shape crow_indices_shape_
Definition internal_convert_indices_from_csr_to_coo.h:31
bool out_int32_
Definition internal_convert_indices_from_csr_to_coo.h:49
DataType crow_indices_type_
Definition internal_convert_indices_from_csr_to_coo.h:35
int device_index_
Definition internal_convert_indices_from_csr_to_coo.h:53
Tensor::Strides col_indices_strides_
Definition internal_convert_indices_from_csr_to_coo.h:39
virtual void operator()(const Tensor crow_indices, const Tensor col_indices, const bool out_int32, const bool transpose, Tensor out) const =0
Definition internal_add_relu.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8