Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 1 | /* |
Sheri Zhang | 78e7691 | 2021-05-06 10:05:22 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2021 Arm Limited. |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Michalis Spyrou | f464337 | 2019-11-29 16:17:13 +0000 | [diff] [blame] | 24 | #ifndef ARM_COMPUTE_GRAPH_GRAPH_BUILDER_H |
| 25 | #define ARM_COMPUTE_GRAPH_GRAPH_BUILDER_H |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 26 | |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 27 | #include "arm_compute/graph/ITensorAccessor.h" |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 28 | #include "arm_compute/graph/LayerDescriptors.h" |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 29 | #include "arm_compute/graph/Types.h" |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 30 | |
| 31 | namespace arm_compute |
| 32 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 33 | namespace graph |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 34 | { |
| 35 | // Forward declaration |
| 36 | class Graph; |
| 37 | |
| 38 | /** Graph builder class |
| 39 | * |
| 40 | * Builds and compiles a graph |
| 41 | */ |
| 42 | class GraphBuilder final |
| 43 | { |
| 44 | public: |
| 45 | /** Adds a Const node to the graph |
| 46 | * |
| 47 | * @param[in] g Graph to add the node to |
| 48 | * @param[in] params Common node parameters |
| 49 | * @param[in] desc Tensor descriptor of the node |
| 50 | * @param[in] accessor (Optional) Accessor of the const node data |
| 51 | * |
| 52 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 53 | */ |
Michalis Spyrou | 299fdd3 | 2019-05-01 13:03:59 +0100 | [diff] [blame] | 54 | static NodeID add_const_node(Graph &g, NodeParams params, const TensorDescriptor &desc, ITensorAccessorUPtr accessor = nullptr); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 55 | /** Adds an input layer node to the graph |
| 56 | * |
| 57 | * @param[in] g Graph to add the node to |
| 58 | * @param[in] params Common node parameters |
| 59 | * @param[in] desc Tensor descriptor of the Tensor |
| 60 | * @param[in] accessor (Optional) Accessor of the input node data |
| 61 | * |
| 62 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 63 | */ |
Michalis Spyrou | 299fdd3 | 2019-05-01 13:03:59 +0100 | [diff] [blame] | 64 | static NodeID add_input_node(Graph &g, NodeParams params, const TensorDescriptor &desc, ITensorAccessorUPtr accessor = nullptr); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 65 | /** Adds an output layer node to the graph |
| 66 | * |
| 67 | * @param[in] g Graph to add the node to |
| 68 | * @param[in] params Common node parameters |
| 69 | * @param[in] input Input to the output node as a NodeID-Index pair |
| 70 | * @param[in] accessor (Optional) Accessor of the output node data |
| 71 | * |
| 72 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 73 | */ |
| 74 | static NodeID add_output_node(Graph &g, NodeParams params, NodeIdxPair input, ITensorAccessorUPtr accessor = nullptr); |
| 75 | /** Adds an activation layer node to the graph |
| 76 | * |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 77 | * @param[in] g Graph to add the node to |
| 78 | * @param[in] params Common node parameters |
| 79 | * @param[in] input Input to the activation layer node as a NodeID-Index pair |
| 80 | * @param[in] act_info Activation layer information |
| 81 | * @param[in] out_quant_info (Optional) Output quantization info |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 82 | * |
| 83 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 84 | */ |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 85 | static NodeID add_activation_node(Graph &g, NodeParams params, NodeIdxPair input, ActivationLayerInfo act_info, |
Michalis Spyrou | 18574c1 | 2019-06-05 10:51:07 +0100 | [diff] [blame] | 86 | const QuantizationInfo &out_quant_info = QuantizationInfo()); |
thecha01 | e8f05da | 2020-08-24 17:21:41 +0100 | [diff] [blame] | 87 | /** Adds an activation layer node to the graph |
| 88 | * |
| 89 | * @param[in] g Graph to add the node to |
| 90 | * @param[in] params Common node parameters |
| 91 | * @param[in] input Input to the activation layer node as a NodeID-Index pair |
| 92 | * @param[in] op Reduction Operation: min or max |
| 93 | * @param[in] axis Axis to perform reduction operation across |
| 94 | * @param[in] out_data_type (Optional) Output data type |
| 95 | * @param[in] out_quant_info (Optional) Output quantization info |
| 96 | * |
| 97 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 98 | */ |
| 99 | static NodeID add_arg_min_max_node(Graph &g, NodeParams params, NodeIdxPair input, ReductionOperation op, unsigned int axis, |
| 100 | DataType out_data_type = DataType::UNKNOWN, |
| 101 | const QuantizationInfo &out_quant_info = QuantizationInfo()); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 102 | /** Adds a batch normalization layer node to the graph |
| 103 | * |
| 104 | * @param[in] g Graph to add the node to |
| 105 | * @param[in] params Common node parameters |
| 106 | * @param[in] input Input to the batch normalization layer node as a NodeID-Index pair |
| 107 | * @param[in] epsilon Epsilon parameter |
| 108 | * @param[in] mean_accessor Const Node ID that contains the mean values |
| 109 | * @param[in] var_accessor Const Node ID that contains the variance values |
| 110 | * @param[in] beta_accessor Const Node ID that contains the beta values. Can be EmptyNodeID |
| 111 | * @param[in] gamma_accessor Const Node ID that contains the gamma values. Can be EmptyNodeID |
| 112 | * |
| 113 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 114 | */ |
| 115 | static NodeID add_batch_normalization_node(Graph &g, NodeParams params, NodeIdxPair input, float epsilon, |
| 116 | ITensorAccessorUPtr mean_accessor = nullptr, ITensorAccessorUPtr var_accessor = nullptr, |
| 117 | ITensorAccessorUPtr beta_accessor = nullptr, ITensorAccessorUPtr gamma_accessor = nullptr); |
Manuel Bottini | d2048ce | 2018-10-23 17:00:42 +0100 | [diff] [blame] | 118 | /** Adds a bounding box transform layer node to the graph |
| 119 | * |
| 120 | * @param[in] g Graph to add the node to |
| 121 | * @param[in] params Common node parameters |
| 122 | * @param[in] input Input to the bounding box transform layer node as a NodeID-Index pair |
| 123 | * @param[in] deltas Deltas input to the bounding box transform layer node as a NodeID-Index pair |
| 124 | * @param[in] info Bounding Box Transform information |
| 125 | * |
| 126 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 127 | */ |
| 128 | static NodeID add_bounding_box_transform_node(Graph &g, NodeParams params, NodeIdxPair input, NodeIdxPair deltas, BoundingBoxTransformInfo info); |
Georgios Pinitas | 087eaf6 | 2018-05-16 15:52:35 +0100 | [diff] [blame] | 129 | /** Adds an channel shuffle layer node to the graph |
| 130 | * |
| 131 | * @param[in] g Graph to add the node to |
| 132 | * @param[in] params Common node parameters |
| 133 | * @param[in] input Input to the activation layer node as a NodeID-Index pair |
| 134 | * @param[in] num_groups Number of groups |
| 135 | * |
| 136 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 137 | */ |
| 138 | static NodeID add_channel_shuffle_node(Graph &g, NodeParams params, NodeIdxPair input, unsigned int num_groups); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 139 | /** Adds a convolution layer node to the graph |
| 140 | * |
| 141 | * @param[in] g Graph to add the node to |
| 142 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 143 | * @param[in] input Input to the convolution layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 144 | * @param[in] kernel_spatial_extend Spatial extend of convolution kernels |
| 145 | * @param[in] depth Number of convolution kernels |
| 146 | * @param[in] conv_info Convolution layer information |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 147 | * @param[in] num_groups (Optional) Number of groups for a grouped convolution. Defaults to 1 |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 148 | * @param[in] method (Optional) Convolution method to use |
Giorgio Arena | 59631a1 | 2018-05-02 13:59:04 +0100 | [diff] [blame] | 149 | * @param[in] fast_math_hint (Optional) Fast math hint |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 150 | * @param[in] weights_accessor (Optional) Accessor of the weights node data |
| 151 | * @param[in] bias_accessor (Optional) Accessor of the bias node data |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 152 | * @param[in] weights_quant_info (Optional) Weights quantization info |
| 153 | * @param[in] out_quant_info (Optional) Output quantization info |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 154 | * |
| 155 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 156 | */ |
| 157 | static NodeID add_convolution_node(Graph &g, NodeParams params, NodeIdxPair input, |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 158 | Size2D kernel_spatial_extend, unsigned int depth, PadStrideInfo conv_info, unsigned int num_groups = 1, |
| 159 | ConvolutionMethod method = ConvolutionMethod::Default, FastMathHint fast_math_hint = FastMathHint::Disabled, |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 160 | ITensorAccessorUPtr weights_accessor = nullptr, ITensorAccessorUPtr bias_accessor = nullptr, |
Michalis Spyrou | 18574c1 | 2019-06-05 10:51:07 +0100 | [diff] [blame] | 161 | const QuantizationInfo &weights_quant_info = QuantizationInfo(), |
| 162 | const QuantizationInfo &out_quant_info = QuantizationInfo()); |
Georgios Pinitas | 087eaf6 | 2018-05-16 15:52:35 +0100 | [diff] [blame] | 163 | /** Adds a deconvolution layer node to the graph |
| 164 | * |
| 165 | * @param[in] g Graph to add the node to |
| 166 | * @param[in] params Common node parameters |
| 167 | * @param[in] input Input to the convolution layer node as a NodeID-Index pair |
| 168 | * @param[in] kernel_spatial_extend Spatial extend of convolution kernels |
| 169 | * @param[in] depth Number of convolution kernels |
| 170 | * @param[in] deconv_info Convolution layer information |
Georgios Pinitas | 087eaf6 | 2018-05-16 15:52:35 +0100 | [diff] [blame] | 171 | * @param[in] weights_accessor (Optional) Accessor of the weights node data |
| 172 | * @param[in] bias_accessor (Optional) Accessor of the bias node data |
| 173 | * |
| 174 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 175 | */ |
| 176 | static NodeID add_deconvolution_node(Graph &g, NodeParams params, NodeIdxPair input, |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 177 | Size2D kernel_spatial_extend, unsigned int depth, PadStrideInfo deconv_info, |
Georgios Pinitas | 087eaf6 | 2018-05-16 15:52:35 +0100 | [diff] [blame] | 178 | ITensorAccessorUPtr weights_accessor = nullptr, ITensorAccessorUPtr bias_accessor = nullptr); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 179 | /** Adds a depth concatenate node to the graph |
| 180 | * |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 181 | * @param[in] g Graph to add the node to |
| 182 | * @param[in] params Common node parameters |
Michele Di Giorgio | ec69975 | 2019-03-22 15:25:32 +0000 | [diff] [blame] | 183 | * @param[in] inputs Inputs to the concatenate layer node as a NodeID-Index pair |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 184 | * @param[in] concat_descriptor Concatenation layer descriptor |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 185 | * |
| 186 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 187 | */ |
Michalis Spyrou | 18574c1 | 2019-06-05 10:51:07 +0100 | [diff] [blame] | 188 | static NodeID add_concatenate_node(Graph &g, NodeParams params, const std::vector<NodeIdxPair> &inputs, const descriptors::ConcatLayerDescriptor &concat_descriptor); |
thecha01 | 0a05e6a | 2020-08-28 18:40:38 +0100 | [diff] [blame] | 189 | /** Adds an depth to space layer node to the graph |
| 190 | * |
| 191 | * @param[in] g Graph to add the node to |
| 192 | * @param[in] params Common node parameters |
| 193 | * @param[in] input Input to the depth to space layer node as a NodeID-Index pair |
| 194 | * @param[in] block_shape Block shape to reshape tensor with |
| 195 | * |
| 196 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 197 | */ |
| 198 | static NodeID add_depth_to_space_node(Graph &g, NodeParams params, NodeIdxPair input, int32_t block_shape); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 199 | /** Adds a depth-wise convolution layer node to the graph |
| 200 | * |
| 201 | * @param[in] g Graph to add the node to |
| 202 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 203 | * @param[in] input Input to the depthwise convolution layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 204 | * @param[in] kernel_spatial_extend Spatial extend of convolution kernels |
| 205 | * @param[in] conv_info Convolution layer information |
Georgios Pinitas | 05045c1 | 2018-12-07 18:31:47 +0000 | [diff] [blame] | 206 | * @param[in] depth_multiplier (Optional) Depth multiplier parameter. |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 207 | * @param[in] method (Optional) Convolution method to use |
| 208 | * @param[in] weights_accessor (Optional) Accessor of the weights node data |
| 209 | * @param[in] bias_accessor (Optional) Accessor of the bias node data |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 210 | * @param[in] quant_info (Optional) Weights quantization info |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 211 | * @param[in] out_quant_info (Optional) Output quantization info |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 212 | * |
| 213 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 214 | */ |
| 215 | static NodeID add_depthwise_convolution_node(Graph &g, NodeParams params, NodeIdxPair input, |
Georgios Pinitas | 05045c1 | 2018-12-07 18:31:47 +0000 | [diff] [blame] | 216 | Size2D kernel_spatial_extend, PadStrideInfo conv_info, int depth_multiplier = 1, |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 217 | DepthwiseConvolutionMethod method = DepthwiseConvolutionMethod::Default, |
Michalis Spyrou | 18574c1 | 2019-06-05 10:51:07 +0100 | [diff] [blame] | 218 | ITensorAccessorUPtr weights_accessor = nullptr, ITensorAccessorUPtr bias_accessor = nullptr, const QuantizationInfo &quant_info = QuantizationInfo(), |
| 219 | const QuantizationInfo &out_quant_info = QuantizationInfo()); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 220 | /** Adds an element-wise layer node to the graph |
| 221 | * |
| 222 | * @param[in] g Graph to add the node to |
| 223 | * @param[in] params Common node parameters |
| 224 | * @param[in] input0 First input to the element-wise operation layer node as a NodeID-Index pair |
| 225 | * @param[in] input1 Second input to the element-wise operation layer node as a NodeID-Index pair |
| 226 | * @param[in] operation Element-wise operation to perform |
| 227 | * |
| 228 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 229 | */ |
| 230 | static NodeID add_elementwise_node(Graph &g, NodeParams params, NodeIdxPair input0, NodeIdxPair input1, EltwiseOperation operation); |
Isabella Gottardi | cd4e9ab | 2019-11-05 17:50:27 +0000 | [diff] [blame] | 231 | /** Adds a dequantization node to the graph |
| 232 | * |
| 233 | * @param[in] g Graph to add the node to |
| 234 | * @param[in] params Common node parameters |
| 235 | * @param[in] input Input to the dequantization node as a NodeID-Index pair |
| 236 | * |
| 237 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 238 | */ |
| 239 | static NodeID add_dequantization_node(Graph &g, NodeParams params, NodeIdxPair input); |
Isabella Gottardi | 7234ed8 | 2018-11-27 08:51:10 +0000 | [diff] [blame] | 240 | /** Adds a detection output layer node to the graph |
| 241 | * |
| 242 | * @param[in] g Graph to add the node to |
| 243 | * @param[in] params Common node parameters |
| 244 | * @param[in] input_loc Location input to the detection output layer node as a NodeID-Index pair |
| 245 | * @param[in] input_conf Confidence input to the detection output layer node as a NodeID-Index pair |
| 246 | * @param[in] input_priorbox PriorBox input to the detection output layer node as a NodeID-Index pair |
| 247 | * @param[in] detect_info Detection output layer parameters |
| 248 | * |
| 249 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 250 | */ |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 251 | static NodeID add_detection_output_node(Graph &g, NodeParams params, NodeIdxPair input_loc, NodeIdxPair input_conf, NodeIdxPair input_priorbox, const DetectionOutputLayerInfo &detect_info); |
Isabella Gottardi | a7acb3c | 2019-01-08 13:48:44 +0000 | [diff] [blame] | 252 | /** Adds a detection post process layer node to the graph |
| 253 | * |
| 254 | * @param[in] g Graph to add the node to |
| 255 | * @param[in] params Common node parameters |
| 256 | * @param[in] input_box_encoding Boxes input to the detection output layer node as a NodeID-Index pair |
| 257 | * @param[in] input_class_prediction Class prediction input to the detection output layer node as a NodeID-Index pair |
| 258 | * @param[in] detect_info Detection output layer parameters |
| 259 | * @param[in] anchors_accessor (Optional) Const Node ID that contains the anchor values |
| 260 | * @param[in] anchor_quant_info (Optional) Anchor quantization info |
| 261 | * |
| 262 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 263 | */ |
| 264 | static NodeID add_detection_post_process_node(Graph &g, NodeParams params, NodeIdxPair input_box_encoding, NodeIdxPair input_class_prediction, |
| 265 | const DetectionPostProcessLayerInfo &detect_info, ITensorAccessorUPtr anchors_accessor = nullptr, |
| 266 | const QuantizationInfo &anchor_quant_info = QuantizationInfo()); |
Georgios Pinitas | 087eaf6 | 2018-05-16 15:52:35 +0100 | [diff] [blame] | 267 | /** Adds a Dummy node to the graph |
| 268 | * |
| 269 | * @note this node if for debugging purposes. Just alters the shape of the graph pipeline as requested. |
| 270 | * |
| 271 | * @param[in] g Graph to add the node to |
| 272 | * @param[in] params Common node parameters |
| 273 | * @param[in] input Input to the dummy node as a NodeID-Index pair |
| 274 | * @param[in] shape Output shape |
| 275 | * |
| 276 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 277 | */ |
| 278 | static NodeID add_dummy_node(Graph &g, NodeParams params, NodeIdxPair input, TensorShape shape); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 279 | /** Adds a flatten layer node to the graph |
| 280 | * |
| 281 | * @param[in] g Graph to add the node to |
| 282 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 283 | * @param[in] input Input to the flatten layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 284 | * |
| 285 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 286 | */ |
| 287 | static NodeID add_flatten_node(Graph &g, NodeParams params, NodeIdxPair input); |
| 288 | /** Adds a fully connected layer node to the graph |
| 289 | * |
Michele Di Giorgio | a42f55f | 2019-03-08 14:52:17 +0000 | [diff] [blame] | 290 | * @param[in] g Graph to add the layer to |
| 291 | * @param[in] params Common node parameters |
| 292 | * @param[in] input Input to the fully connected layer node as a NodeID-Index pair |
| 293 | * @param[in] num_outputs Number of output neurons |
| 294 | * @param[in] weights_nid Node ID of the weights node data |
| 295 | * @param[in] bias_nid (Optional) Node ID of the bias node data. Defaults to EmptyNodeID |
| 296 | * @param[in] fc_info (Optional) Fully connected layer metadata |
| 297 | * @param[in] out_quant_info (Optional) Output quantization info |
cfRod | f2c022e | 2021-11-05 11:29:53 +0000 | [diff] [blame] | 298 | * @param[in] fast_math_hint (Optional) Fast math hint |
Michele Di Giorgio | a42f55f | 2019-03-08 14:52:17 +0000 | [diff] [blame] | 299 | * |
| 300 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 301 | */ |
| 302 | static NodeID add_fully_connected_layer(Graph &g, NodeParams params, NodeIdxPair input, unsigned int num_outputs, |
| 303 | NodeID weights_nid, NodeID bias_nid = EmptyNodeID, |
| 304 | const FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo(), |
cfRod | f2c022e | 2021-11-05 11:29:53 +0000 | [diff] [blame] | 305 | const QuantizationInfo &out_quant_info = QuantizationInfo(), |
| 306 | FastMathHint fast_math_hint = FastMathHint::Disabled); |
Michele Di Giorgio | a42f55f | 2019-03-08 14:52:17 +0000 | [diff] [blame] | 307 | /** Adds a fully connected layer node to the graph |
| 308 | * |
Georgios Pinitas | 2f1366a | 2018-07-31 16:33:06 +0100 | [diff] [blame] | 309 | * @param[in] g Graph to add the layer to |
| 310 | * @param[in] params Common node parameters |
| 311 | * @param[in] input Input to the fully connected layer node as a NodeID-Index pair |
| 312 | * @param[in] num_outputs Number of output neurons |
| 313 | * @param[in] weights_accessor (Optional) Accessor of the weights node data |
| 314 | * @param[in] bias_accessor (Optional) Accessor of the bias node data |
Georgios Pinitas | c55cef1 | 2018-08-01 15:24:18 +0100 | [diff] [blame] | 315 | * @param[in] fc_info (Optional) Fully connected layer metadata |
Georgios Pinitas | 2f1366a | 2018-07-31 16:33:06 +0100 | [diff] [blame] | 316 | * @param[in] weights_quant_info (Optional) Weights quantization info |
| 317 | * @param[in] out_quant_info (Optional) Output quantization info |
cfRod | f2c022e | 2021-11-05 11:29:53 +0000 | [diff] [blame] | 318 | * @param[in] fast_math_hint (Optional) Fast math hint |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 319 | * |
| 320 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 321 | */ |
| 322 | static NodeID add_fully_connected_layer(Graph &g, NodeParams params, NodeIdxPair input, unsigned int num_outputs, |
Georgios Pinitas | 2f1366a | 2018-07-31 16:33:06 +0100 | [diff] [blame] | 323 | ITensorAccessorUPtr weights_accessor = nullptr, ITensorAccessorUPtr bias_accessor = nullptr, |
Georgios Pinitas | c55cef1 | 2018-08-01 15:24:18 +0100 | [diff] [blame] | 324 | const FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo(), |
Michalis Spyrou | 18574c1 | 2019-06-05 10:51:07 +0100 | [diff] [blame] | 325 | const QuantizationInfo &weights_quant_info = QuantizationInfo(), |
cfRod | f2c022e | 2021-11-05 11:29:53 +0000 | [diff] [blame] | 326 | const QuantizationInfo &out_quant_info = QuantizationInfo(), |
| 327 | FastMathHint fast_math_hint = FastMathHint::Disabled); |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 328 | /** Adds a generate proposals layer node to the graph |
| 329 | * |
| 330 | * @param[in] g Graph to add the layer to |
| 331 | * @param[in] params Common node parameters |
| 332 | * @param[in] scores Input scores to the generate proposals layer node as a NodeID-Index pair |
| 333 | * @param[in] deltas Input deltas to the generate proposals layer node as a NodeID-Index pair |
| 334 | * @param[in] anchors Input anchors to the generate proposals layer node as a NodeID-Index pair |
| 335 | * @param[in] info Generate proposals operation information |
| 336 | * |
| 337 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 338 | */ |
| 339 | static NodeID add_generate_proposals_node(Graph &g, NodeParams params, NodeIdxPair scores, NodeIdxPair deltas, |
| 340 | NodeIdxPair anchors, GenerateProposalsInfo info); |
thecha01 | 3603aff | 2020-09-01 14:52:38 +0100 | [diff] [blame] | 341 | /** Adds a L2 Normalize layer node to the graph |
| 342 | * |
| 343 | * @param[in] g Graph to add the node to |
| 344 | * @param[in] params Common node parameters |
| 345 | * @param[in] input Input to the normalization layer node as a NodeID-Index pair |
| 346 | * @param[in] axis Axis to perform normalization on |
| 347 | * @param[in] epsilon Lower bound value for the normalization |
| 348 | * |
| 349 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 350 | */ |
| 351 | static NodeID add_l2_normalize_node(Graph &g, NodeParams params, NodeIdxPair input, int axis, float epsilon); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 352 | /** Adds a normalization layer node to the graph |
| 353 | * |
| 354 | * @param[in] g Graph to add the node to |
| 355 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 356 | * @param[in] input Input to the normalization layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 357 | * @param[in] norm_info Normalization layer information |
| 358 | * |
| 359 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 360 | */ |
| 361 | static NodeID add_normalization_node(Graph &g, NodeParams params, NodeIdxPair input, NormalizationLayerInfo norm_info); |
Michele Di Giorgio | 555d110 | 2018-09-12 13:51:59 +0100 | [diff] [blame] | 362 | /** Adds a normalize planar YUV layer node to the graph |
| 363 | * |
| 364 | * @param[in] g Graph to add the node to |
| 365 | * @param[in] params Common node parameters |
| 366 | * @param[in] input Input to the normalize planar YUV layer node as a NodeID-Index pair |
| 367 | * @param[in] mean_accessor Const Node ID that contains the mean values |
| 368 | * @param[in] std_accessor Const Node ID that contains the variance values |
| 369 | * |
| 370 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 371 | */ |
| 372 | static NodeID add_normalize_planar_yuv_node(Graph &g, NodeParams params, NodeIdxPair input, |
| 373 | ITensorAccessorUPtr mean_accessor = nullptr, ITensorAccessorUPtr std_accessor = nullptr); |
Michele Di Giorgio | 4bb1733 | 2018-09-26 13:56:51 +0100 | [diff] [blame] | 374 | /** Adds a pad layer node to the graph |
| 375 | * |
Georgios Pinitas | 102b0ce | 2020-02-13 17:59:09 +0000 | [diff] [blame] | 376 | * @param[in] g Graph to add the node to |
| 377 | * @param[in] params Common node parameters |
| 378 | * @param[in] input Input to the reshape layer node as a NodeID-Index pair |
| 379 | * @param[in] paddings The padding for each spatial dimension of the input tensor. The pair padding[i] |
| 380 | * specifies the front and the end padding in the i-th dimension. |
| 381 | * @param[in] pad_value Padding value to be used. Defaults to 0 |
Michele Di Giorgio | 4bb1733 | 2018-09-26 13:56:51 +0100 | [diff] [blame] | 382 | * |
| 383 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 384 | */ |
Georgios Pinitas | 102b0ce | 2020-02-13 17:59:09 +0000 | [diff] [blame] | 385 | static NodeID add_pad_node(Graph &g, NodeParams params, NodeIdxPair input, const PaddingList &paddings, PixelValue pad_value = PixelValue()); |
Georgios Pinitas | 57c4824 | 2018-08-02 13:41:49 +0100 | [diff] [blame] | 386 | /** Adds a permute layer node to the graph |
| 387 | * |
| 388 | * @param[in] g Graph to add the node to |
| 389 | * @param[in] params Common node parameters |
| 390 | * @param[in] input Input to the reshape layer node as a NodeID-Index pair |
| 391 | * @param[in] perm Permutation vector |
| 392 | * @param[in] layout (Optional) Data layout to assign to permuted tensor. |
| 393 | * If UNKNOWN then the input's layout will be used. |
| 394 | * |
| 395 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 396 | */ |
| 397 | static NodeID add_permute_node(Graph &g, NodeParams params, NodeIdxPair input, PermutationVector perm, DataLayout layout = DataLayout::UNKNOWN); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 398 | /** Adds a pooling layer node to the graph |
| 399 | * |
| 400 | * @param[in] g Graph to add the node to |
| 401 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 402 | * @param[in] input Input to the pooling layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 403 | * @param[in] pool_info Pooling layer information |
| 404 | * |
| 405 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 406 | */ |
| 407 | static NodeID add_pooling_node(Graph &g, NodeParams params, NodeIdxPair input, PoolingLayerInfo pool_info); |
Georgios Pinitas | f8c4749 | 2020-02-04 17:39:59 +0000 | [diff] [blame] | 408 | /** Adds a prelu layer node to the graph |
| 409 | * |
| 410 | * @param[in] g Graph to add the node to |
| 411 | * @param[in] params Common node parameters |
| 412 | * @param[in] input Input to the PRelu node as a NodeID-Index pair |
| 413 | * @param[in] alpha Alpha input to the PRelu node as a NodeID-Index pair |
| 414 | * |
| 415 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 416 | */ |
| 417 | static NodeID add_prelu_node(Graph &g, NodeParams params, NodeIdxPair input, NodeIdxPair alpha); |
Giorgio Arena | 6e9d0e0 | 2020-01-03 15:02:04 +0000 | [diff] [blame] | 418 | /** Adds a print layer node to the graph |
| 419 | * |
| 420 | * @param[in] g Graph to add the node to |
| 421 | * @param[in] params Common node parameters |
| 422 | * @param[in] input Input to the print layer node as a NodeID-Index pair |
| 423 | * @param[in] stream Output stream. |
| 424 | * @param[in] format_info (Optional) Format info. |
| 425 | * @param[in] transform (Optional) Transformation function to be applied to the input tensor before printing. |
| 426 | * |
| 427 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 428 | */ |
| 429 | static NodeID add_print_node(Graph &g, NodeParams params, NodeIdxPair input, std::ostream &stream, const IOFormatInfo &format_info = IOFormatInfo(), |
| 430 | const std::function<ITensor *(ITensor *)> transform = nullptr); |
Pablo Tello | 3252143 | 2018-11-15 14:43:10 +0000 | [diff] [blame] | 431 | /** Adds a priorbox layer node to the graph |
| 432 | * |
| 433 | * @param[in] g Graph to add the node to |
| 434 | * @param[in] params Common node parameters |
| 435 | * @param[in] input0 First input to the priorbox layer node as a NodeID-Index pair |
| 436 | * @param[in] input1 Second input to the priorbox layer node as a NodeID-Index pair |
| 437 | * @param[in] prior_info PriorBox parameters |
| 438 | * |
| 439 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 440 | */ |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 441 | static NodeID add_priorbox_node(Graph &g, NodeParams params, NodeIdxPair input0, NodeIdxPair input1, const PriorBoxLayerInfo &prior_info); |
Isabella Gottardi | 3db1ba9 | 2019-05-17 12:35:20 +0100 | [diff] [blame] | 442 | /** Adds a quantization layer node to the graph |
| 443 | * |
| 444 | * @param[in] g Graph to add the node to |
| 445 | * @param[in] params Common node parameters |
| 446 | * @param[in] input Input to the quantization layer node as a NodeID-Index pair |
| 447 | * @param[in] out_quant_info Output quantization info |
| 448 | * |
| 449 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 450 | */ |
Michalis Spyrou | 18574c1 | 2019-06-05 10:51:07 +0100 | [diff] [blame] | 451 | static NodeID add_quantization_node(Graph &g, NodeParams params, NodeIdxPair input, const QuantizationInfo &out_quant_info); |
thecha01 | d64444b | 2020-09-07 14:50:21 +0100 | [diff] [blame] | 452 | /** Adds a reduction sum layer node to the graph |
| 453 | * |
| 454 | * @param[in] g Graph to add the node to |
| 455 | * @param[in] params Common node parameters |
| 456 | * @param[in] input Input to the reorg layer node as a NodeID-Index pair |
| 457 | * @param[in] op Reduction operation |
| 458 | * @param[in] axis Reduction axis |
| 459 | * @param[in] keep_dims (Optional) Whether to keep the reduced dimension after the operation. Defaults to true. |
| 460 | * |
| 461 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 462 | */ |
| 463 | static NodeID add_reduction_operation_node(Graph &g, NodeParams params, NodeIdxPair input, ReductionOperation op, int axis, bool keep_dims = true); |
Gian Marco Iodice | 23e2479 | 2018-09-07 15:32:14 +0100 | [diff] [blame] | 464 | /** Adds a reorg layer node to the graph |
| 465 | * |
| 466 | * @param[in] g Graph to add the node to |
| 467 | * @param[in] params Common node parameters |
| 468 | * @param[in] input Input to the reorg layer node as a NodeID-Index pair |
| 469 | * @param[in] stride Stride value to use for reorganizing the values in the output tensor. |
| 470 | * |
| 471 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 472 | */ |
| 473 | static NodeID add_reorg_node(Graph &g, NodeParams params, NodeIdxPair input, int stride); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 474 | /** Adds a reshape layer node to the graph |
| 475 | * |
| 476 | * @param[in] g Graph to add the node to |
| 477 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 478 | * @param[in] input Input to the reshape layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 479 | * @param[in] shape Output reshaped shape |
| 480 | * |
| 481 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 482 | */ |
| 483 | static NodeID add_reshape_node(Graph &g, NodeParams params, NodeIdxPair input, TensorShape shape); |
Georgios Pinitas | 087eaf6 | 2018-05-16 15:52:35 +0100 | [diff] [blame] | 484 | /** Adds a resize layer node to the graph |
| 485 | * |
| 486 | * @param[in] g Graph to add the node to |
| 487 | * @param[in] params Common node parameters |
| 488 | * @param[in] input Input to the reshape layer node as a NodeID-Index pair |
| 489 | * @param[in] policy Interpolation policy |
| 490 | * @param[in] width_scale Width scaling factor |
| 491 | * @param[in] height_scale Height scaling factor |
| 492 | * |
| 493 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 494 | */ |
| 495 | static NodeID add_resize_node(Graph &g, NodeParams params, NodeIdxPair input, InterpolationPolicy policy, float width_scale, float height_scale); |
Manuel Bottini | 3f9d4d7 | 2018-10-19 14:04:42 +0100 | [diff] [blame] | 496 | /** Adds a ROI align layer node to the graph |
| 497 | * |
| 498 | * @param[in] g Graph to add the node to |
| 499 | * @param[in] params Common node parameters |
| 500 | * @param[in] input Input to the reshape layer node as a NodeID-Index pair |
Manuel Bottini | cc5171b | 2019-01-09 17:04:39 +0000 | [diff] [blame] | 501 | * @param[in] rois Input containing the ROIs. |
Manuel Bottini | 3f9d4d7 | 2018-10-19 14:04:42 +0100 | [diff] [blame] | 502 | * @param[in] pool_info Contains pooling operation information described in @ref ROIPoolingLayerInfo. |
| 503 | * |
| 504 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 505 | */ |
| 506 | static NodeID add_roi_align_node(Graph &g, NodeParams params, NodeIdxPair input, NodeIdxPair rois, ROIPoolingLayerInfo pool_info); |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 507 | /** Adds a scale layer node to the graph |
| 508 | * This layer computes a product of the input with a scale (read from mul_accessor) and it applies an offset (read from add_accessor). |
| 509 | * output = input * mul_w + add_w |
| 510 | * |
| 511 | * @param[in] g Graph to add the layer to |
| 512 | * @param[in] params Common node parameters |
| 513 | * @param[in] input Input to the fully connected layer node as a NodeID-Index pair |
| 514 | * @param[in] mul_accessor (Optional) Accessor of the mul node data |
| 515 | * @param[in] add_accessor (Optional) Accessor of the add node data |
| 516 | * |
| 517 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 518 | */ |
| 519 | static NodeID add_scale_layer(Graph &g, const NodeParams ¶ms, NodeIdxPair input, |
| 520 | ITensorAccessorUPtr mul_accessor = nullptr, ITensorAccessorUPtr add_accessor = nullptr); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 521 | /** Adds a softmax node to the graph |
| 522 | * |
| 523 | * @param[in] g Graph to add the node to |
| 524 | * @param[in] params Common node parameters |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 525 | * @param[in] input Input to the softmax layer node as a NodeID-Index pair |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 526 | * @param[in] beta Beta parameter |
| 527 | * |
| 528 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 529 | */ |
| 530 | static NodeID add_softmax_node(Graph &g, NodeParams params, NodeIdxPair input, float beta = 1.f); |
Michele Di Giorgio | c30b668 | 2018-09-12 17:44:08 +0100 | [diff] [blame] | 531 | /** Adds a slice node to the graph |
| 532 | * |
| 533 | * @param[in] g Graph to add the node to |
| 534 | * @param[in] params Common node parameters |
| 535 | * @param[in] input Input to the slice layer node as a NodeID-Index pair |
| 536 | * @param[in] starts The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
| 537 | * @param[in] ends The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
| 538 | * |
| 539 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 540 | */ |
| 541 | static NodeID add_slice_node(Graph &g, NodeParams params, NodeIdxPair input, Coordinates &starts, Coordinates &ends); |
Georgios Pinitas | ee33ea5 | 2018-03-08 16:01:29 +0000 | [diff] [blame] | 542 | /** Adds a split node to the graph |
| 543 | * |
| 544 | * @param[in] g Graph to add the node to |
| 545 | * @param[in] params Common node parameters |
| 546 | * @param[in] input Input to the split layer node as a NodeID-Index pair |
| 547 | * @param[in] num_splits Number of different splits |
| 548 | * @param[in] axis (Optional) Split axis. Defaults to 0 |
| 549 | * |
| 550 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 551 | */ |
| 552 | static NodeID add_split_node(Graph &g, NodeParams params, NodeIdxPair input, unsigned int num_splits, unsigned int axis = 0); |
Michele Di Giorgio | ec69975 | 2019-03-22 15:25:32 +0000 | [diff] [blame] | 553 | /** Adds a stack layer node to the graph |
| 554 | * |
| 555 | * @param[in] g Graph to add the node to |
| 556 | * @param[in] params Common node parameters |
| 557 | * @param[in] inputs Inputs to the reorg layer node as a NodeID-Index pair |
| 558 | * @param[in] axis Axis along which the input tensors have to be packed |
| 559 | * |
| 560 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 561 | */ |
| 562 | static NodeID add_stack_node(Graph &g, NodeParams params, const std::vector<NodeIdxPair> &inputs, int axis); |
thecha01 | 2bfadd9 | 2020-08-12 17:25:51 +0100 | [diff] [blame] | 563 | /** Adds a strided slice node to the graph |
| 564 | * |
| 565 | * @param[in] g Graph to add the node to |
| 566 | * @param[in] params Common node parameters |
| 567 | * @param[in] input Input to the strided slice layer node as a NodeID-Index pair |
| 568 | * @param[in] starts The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
| 569 | * @param[in] ends The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
| 570 | * @param[in] strides The strides of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
| 571 | * @param[in] info Contains masks for the starts, ends and strides |
| 572 | * |
| 573 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 574 | */ |
| 575 | static NodeID add_strided_slice_node(Graph &g, NodeParams params, NodeIdxPair input, Coordinates &starts, Coordinates &ends, BiStrides &strides, StridedSliceLayerInfo info); |
Michalis Spyrou | 96f6769 | 2018-09-13 11:39:28 +0100 | [diff] [blame] | 576 | /** Adds a yolo layer to the graph |
| 577 | * |
Georgios Pinitas | 0b1c2db | 2020-12-04 15:51:34 +0000 | [diff] [blame] | 578 | * @param[in] g Graph to add the node to |
| 579 | * @param[in] params Common node parameters |
| 580 | * @param[in] input Input to the yolo layer node as a NodeID-Index pair |
| 581 | * @param[in] act_info Activation layer parameters |
Michalis Spyrou | 96f6769 | 2018-09-13 11:39:28 +0100 | [diff] [blame] | 582 | * |
| 583 | * @return Node ID of the created node, EmptyNodeID in case of error |
| 584 | */ |
Georgios Pinitas | 0b1c2db | 2020-12-04 15:51:34 +0000 | [diff] [blame] | 585 | static NodeID add_yolo_node(Graph &g, NodeParams params, NodeIdxPair input, ActivationLayerInfo act_info); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 586 | }; |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 587 | } // namespace graph |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 588 | } // namespace arm_compute |
Michalis Spyrou | f464337 | 2019-11-29 16:17:13 +0000 | [diff] [blame] | 589 | #endif /* ARM_COMPUTE_GRAPH_GRAPH_BUILDER_H */ |