Fuse pad layer with subsequent convolution layer

Fusing occurs only if
  - the padding is only for height/width
  - padding pixel value is 0
  - padding node output has no accessors

Resolves: COMPMID-4702

Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: I0755d5fb0bd3a55d9f10b32ce9da44e7c5a25279
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6189
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Georgios Pinitas <georgios.pinitas@arm.com>
diff --git a/src/graph/Utils.cpp b/src/graph/Utils.cpp
index 7309737..7db06b9 100644
--- a/src/graph/Utils.cpp
+++ b/src/graph/Utils.cpp
@@ -194,6 +194,26 @@
     return driving_nodes;
 }
 
+std::vector<NodeIdxPair> get_driver_nodes(const INode &node)
+{
+    std::vector<NodeIdxPair> driver_nodes;
+
+    const Graph *g = node.graph();
+    ARM_COMPUTE_ERROR_ON(g == nullptr);
+
+    for(auto &input_edge_id : node.input_edges())
+    {
+        auto input_edge = g->edge(input_edge_id);
+        if(input_edge != nullptr)
+        {
+            ARM_COMPUTE_ERROR_ON(input_edge->producer() == nullptr);
+            driver_nodes.push_back({ input_edge->producer_id(), input_edge->producer_idx() });
+        }
+    }
+
+    return driver_nodes;
+}
+
 void configure_tensor(Tensor *tensor)
 {
     if(tensor != nullptr && tensor->handle() == nullptr)