onnx2versal
Loading...
Searching...
No Matches
graph_dequantize_linear.h
1#ifndef __DEQUANTIZE_LINEAR_GRAPH_H__
2#define __DEQUANTIZE_LINEAR_GRAPH_H__
3
4#include <assert.h>
5#include <adf.h>
6#include "dequantize_linear.h"
7
8
36template <template<typename, int, int, int> class DEQUANTIZE_LINEAR,
37 typename TT, int B, int INP_W, int OUT_W>
38class DequantizeLinearGraph : public adf::graph {
39
40 private:
41 adf::kernel k[1];
42 std::string id;
43
44 public:
45 adf::port<input> pin[1];
46 adf::port<output> pout[1];
47
49 float scale,
50 TT zero,
51 int repeat_cnt = 1
52 ) {
53 static_assert(INP_W >= OUT_W);
54 k[0] = adf::kernel::create_object<DEQUANTIZE_LINEAR<TT, B, INP_W, OUT_W>>(scale, zero);
55 adf::source(k[0]) = "dequantize_linear.cc";
56 adf::headers(k[0]) = {"dequantize_linear.h"};
57 adf::runtime<ratio>(k[0]) = 0.6;
58 adf::repetition_count(k[0]) = repeat_cnt;
59
60 adf::connect<adf::window<B*INP_W>> (pin[0], k[0].in[0]);
61 adf::connect<adf::window<B*OUT_W*4>> (k[0].out[0], pout[0]);
62 }
63
64};
68#endif // __DEQUANTIZE_LINEAR_GRAPH_H__
Single instance graph.
Definition graph_dequantize_linear.h:38