diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2018-10-23 17:00:42 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-11-08 13:43:34 +0000 |
commit | d2048ce58a88853cee6cdd67fe0d6f09c3e212b0 (patch) | |
tree | 4107f577ab792509edd023b00003e7ef85cfacc2 /arm_compute/graph/backends/FunctionHelpers.h | |
parent | 0c54a62f334b6cfdca99066d8de3ed6a0b2fa15e (diff) | |
download | ComputeLibrary-d2048ce58a88853cee6cdd67fe0d6f09c3e212b0.tar.gz |
COMPMID-1638 - Add BBoxTransform to the graph API
Change-Id: I67cbbce59d61d907fc4dc4c3997e96b347dfe895
Diffstat (limited to 'arm_compute/graph/backends/FunctionHelpers.h')
-rw-r--r-- | arm_compute/graph/backends/FunctionHelpers.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arm_compute/graph/backends/FunctionHelpers.h b/arm_compute/graph/backends/FunctionHelpers.h index 1968ec3923..d235fe9f6f 100644 --- a/arm_compute/graph/backends/FunctionHelpers.h +++ b/arm_compute/graph/backends/FunctionHelpers.h @@ -159,6 +159,42 @@ std::unique_ptr<IFunction> create_batch_normalization_layer(BatchNormalizationLa return std::move(func); } +/** Create a backend bounding box transform layer function + * + * @tparam BoundingBoxTransformLayerFunction Backend bounding box transform function + * @tparam TargetInfo Target-specific information + * + * @param[in] node Node to create the backend function for + * + * @return Backend bounding box transform layer function + */ +template <typename BoundingBoxTransformLayerFunction, typename TargetInfo> +std::unique_ptr<IFunction> create_bounding_box_transform_layer(BoundingBoxTransformLayerNode &node) +{ + validate_node<TargetInfo>(node, 2 /* expected inputs */, 1 /* expected outputs */); + + // Extract IO and info + typename TargetInfo::TensorType *input = get_backing_tensor<TargetInfo>(node.input(0)); + typename TargetInfo::TensorType *deltas = get_backing_tensor<TargetInfo>(node.input(1)); + typename TargetInfo::TensorType *output = get_backing_tensor<TargetInfo>(node.output(0)); + const BoundingBoxTransformInfo bbox_info = node.info(); + + // Create and configure function + auto func = support::cpp14::make_unique<BoundingBoxTransformLayerFunction>(); + func->configure(input, output, deltas, bbox_info); + + // Log info + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.type() + << " Target " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() + << " Shape: " << input->info()->tensor_shape() + << " BoundingBox Info img W: " << bbox_info.img_width() << " " + << " BoundingBox Info img H: " << bbox_info.img_height() << " " + << std::endl); + + return std::move(func); +} + /** Create a backend channel shuffle layer function * * @tparam ChannelShuffleLayerFunction Backend channel shuffle function |