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