onnx2versal
Loading...
Searching...
No Matches
graph_softmax.h
1#ifndef __SOFTMAX_GRAPH_H__
2#define __SOFTMAX_GRAPH_H__
3
4#include <adf.h>
5#include "softmax.h"
6
7
31template <template<int, int, int> class SOFTMAX,
32 int INP_H, int INP_W, int INP_W_PAD>
33class SoftmaxGraph : public adf::graph {
34
35 private:
36 adf::kernel k[1];
37 std::string id;
38
39 public:
40 adf::port<input> pin[1];
41 adf::port<output> pout[1];
42
43 SoftmaxGraph() {
44 k[0] = adf::kernel::create_object<SOFTMAX<INP_H, INP_W, INP_W_PAD>>();
45 adf::source(k[0]) = "softmax.cc";
46 adf::headers(k[0]) = {"softmax.h"};
47 adf::runtime<ratio>(k[0]) = 0.6;
48
49 adf::connect<adf::window<INP_H*INP_W_PAD*4>> (pin[0], k[0].in[0]);
50 adf::connect<adf::window<INP_H*INP_W_PAD*4>> (k[0].out[0], pout[0]);
51 }
52
53};
57#endif // __SOFTMAX_GRAPH_H__
Single instance graph.
Definition graph_softmax.h:33