Graph builder class * * Builds and compiles a graph */
| 44 | * Builds and compiles a graph |
| 45 | */ |
| 46 | class GraphBuilder final |
| 47 | { |
| 48 | public: |
| 49 | /** Adds a Const node to the graph |
| 50 | * |
| 51 | * @param[in] g Graph to add the node to |
| 52 | * @param[in] params Common node parameters |
| 53 | * @param[in] desc Tensor descriptor of the node |
| 54 | * @param[in] accessor (Optional) Accessor of the const node data |
| 55 | * |
| 56 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 57 | */ |
| 58 | static NodeID |
| 59 | add_const_node(Graph &g, NodeParams params, const TensorDescriptor &desc, ITensorAccessorUPtr accessor = nullptr); |
| 60 | /** Adds an input layer node to the graph |
| 61 | * |
| 62 | * @param[in] g Graph to add the node to |
| 63 | * @param[in] params Common node parameters |
| 64 | * @param[in] desc Tensor descriptor of the Tensor |
| 65 | * @param[in] accessor (Optional) Accessor of the input node data |
| 66 | * |
| 67 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 68 | */ |
| 69 | static NodeID |
| 70 | add_input_node(Graph &g, NodeParams params, const TensorDescriptor &desc, ITensorAccessorUPtr accessor = nullptr); |
| 71 | /** Adds an output layer node to the graph |
| 72 | * |
| 73 | * @param[in] g Graph to add the node to |
| 74 | * @param[in] params Common node parameters |
| 75 | * @param[in] input Input to the output node as a NodeID-Index pair |
| 76 | * @param[in] accessor (Optional) Accessor of the output node data |
| 77 | * |
| 78 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 79 | */ |
| 80 | static NodeID |
| 81 | add_output_node(Graph &g, NodeParams params, NodeIdxPair input, ITensorAccessorUPtr accessor = nullptr); |
| 82 | /** Adds an activation layer node to the graph |
| 83 | * |
| 84 | * @param[in] g Graph to add the node to |
| 85 | * @param[in] params Common node parameters |
| 86 | * @param[in] input Input to the activation layer node as a NodeID-Index pair |
| 87 | * @param[in] act_info Activation layer information |
| 88 | * @param[in] out_quant_info (Optional) Output quantization info |
| 89 | * |
| 90 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 91 | */ |
| 92 | static NodeID add_activation_node(Graph &g, |
| 93 | NodeParams params, |
| 94 | NodeIdxPair input, |
| 95 | ActivationLayerInfo act_info, |
| 96 | const QuantizationInfo &out_quant_info = QuantizationInfo()); |
| 97 | /** Adds an activation layer node to the graph |
| 98 | * |
| 99 | * @param[in] g Graph to add the node to |
| 100 | * @param[in] params Common node parameters |
| 101 | * @param[in] input Input to the activation layer node as a NodeID-Index pair |
| 102 | * @param[in] op Reduction Operation: min or max |
| 103 | * @param[in] axis Axis to perform reduction operation across |
nothing calls this directly
no test coverage detected