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