onnx2versal
Loading...
Searching...
No Matches
dequantize_linear.h
1#ifndef DEQUANTIZE_LINEAR_H
2#define DEQUANTIZE_LINEAR_H
3
4#include <adf.h>
5
6
22template <typename TT, int B, int INP_W, int OUT_W>
24
25 private:
26 float scale;
27 TT zero; // same type as output
28
29 public:
31 float scale,
32 TT zero
33 ): scale(scale), zero(zero) {};
34
35 void filter(
36 input_window<TT>* in,
37 output_window<float>* out
38 );
39
40 static void registerKernelClass() {
41 REGISTER_FUNCTION(DequantizeLinearScalar::filter);
42 }
43};
44
45
50template <typename TT, int B, int INP_W, int OUT_W>
52
53 private:
54 float scale;
55 TT zero; // same type as output
56
57 // precompute
58 int32_t iscale;
59 int32_t ishift;
60 int bitshift;
61
62 public:
64 float scale,
65 TT zero
66 );
67
68 void filter(
69 input_window<TT>* in,
70 output_window<float>* out
71 );
72
73 static void registerKernelClass() {
74 REGISTER_FUNCTION(DequantizeLinear::filter);
75 }
76};
80#endif // DEQUANTIZE_LINEAR_H
Scalar implementation, DequantizeLinearScalar<96,84> takes 296 cycles.
Definition dequantize_linear.h:23
Vector implementation, DequantizeLinear<96,84> takes 154 cycles.
Definition dequantize_linear.h:51