aboutsummaryrefslogtreecommitdiff
path: root/arm_compute
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h16
-rw-r--r--arm_compute/graph/SubGraph.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index 52773faa3a..f31eb3d336 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -25,6 +25,7 @@
#define __ARM_COMPUTE_MISC_SHAPE_CALCULATOR_H__
#include "arm_compute/core/ITensorInfo.h"
+#include "arm_compute/core/Utils.h"
namespace arm_compute
{
@@ -98,6 +99,21 @@ inline TensorShape compute_transposed_shape(const ITensorInfo &input)
return shape_transposed;
}
+inline TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input, const ITensorInfo &weights, PadStrideInfo conv_info)
+{
+ const TensorShape input_shape{ input.tensor_shape() };
+ const TensorShape weights_shape{ weights.tensor_shape() };
+
+ unsigned int output_width = 0;
+ unsigned int output_height = 0;
+ std::tie(output_width, output_height) = scaled_dimensions(input_shape.x(), input_shape.y(), weights_shape.x(), weights_shape.y(), conv_info);
+
+ TensorShape output_shape{ input_shape };
+ output_shape.set(0, output_width);
+ output_shape.set(1, output_height);
+
+ return output_shape;
+}
} // namespace shape_calculator
} // namespace misc
} // namespace arm_compute
diff --git a/arm_compute/graph/SubGraph.h b/arm_compute/graph/SubGraph.h
index d768bf9119..e3217e7095 100644
--- a/arm_compute/graph/SubGraph.h
+++ b/arm_compute/graph/SubGraph.h
@@ -56,13 +56,13 @@ public:
void add_tensor_object(std::unique_ptr<ITensorObject> tensor);
/** Constructs a graph from a subgraph
*
- * @param[in] hint Execution target hint
+ * @param[in] ctx Parent graph context
* @param[in] input Input to the graph
* @param[in] output Output to the graph
*
* @return A graph
*/
- std::unique_ptr<Graph> construct(TargetHint hint, std::unique_ptr<ITensorObject> input, std::unique_ptr<ITensorObject> output);
+ std::unique_ptr<Graph> construct(const GraphContext &ctx, std::unique_ptr<ITensorObject> input, std::unique_ptr<ITensorObject> output);
/** Checks if the subgraph has an input
*
* @return True if the sub-graph has an input else false