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