IVGCVSW-7830 Clean up

 * Follow up review to clean up whitespace and copyright errors mentioned
   in https://review.mlplatform.org/c/ml/armnn/+/9885
 * Added BinaryElementwiseOperation to .dot files
 * Refactored ConnectedToSplitterWithMoreThan4Dims function to more
   generally useful ConnectedToLayerType function

Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I0e3d0895888f3a3f0a9758ce30bc031aba50812b
diff --git a/src/backends/backendsCommon/OptimizationViews.cpp b/src/backends/backendsCommon/OptimizationViews.cpp
index a358f88..c9a8c7d 100644
--- a/src/backends/backendsCommon/OptimizationViews.cpp
+++ b/src/backends/backendsCommon/OptimizationViews.cpp
@@ -64,7 +64,7 @@
         for (auto& substitution : m_SuccesfulOptimizations)
         {
             bool validSubstitution = true;
-            const SubgraphView &replacement = substitution.m_ReplacementSubgraph;
+            const SubgraphView& replacement = substitution.m_ReplacementSubgraph;
             const SubgraphView& old = substitution.m_SubstitutableSubgraph;
             validSubstitution &= replacement.GetIInputSlots().size() == old.GetIInputSlots().size();
             validSubstitution &= replacement.GetIOutputSlots().size() == old.GetIOutputSlots().size();
diff --git a/src/backends/backendsCommon/SubgraphUtils.hpp b/src/backends/backendsCommon/SubgraphUtils.hpp
index 823da76..9f2cdba 100644
--- a/src/backends/backendsCommon/SubgraphUtils.hpp
+++ b/src/backends/backendsCommon/SubgraphUtils.hpp
@@ -33,7 +33,7 @@
         {
             case armnn::LayerType::BatchMatMul:
             {
-                auto desc = static_cast<const armnn::BatchMatMulDescriptor &>(descriptor);
+                auto desc = static_cast<const armnn::BatchMatMulDescriptor&>(descriptor);
                 m_Result = desc.m_DataLayoutX == DataLayout::NCHW || desc.m_DataLayoutY == DataLayout::NCHW;
                 break;
             }
@@ -219,12 +219,14 @@
     return false;
 }
 
-/// Checks if the Layer is connected to a Splitter Layer through a Tensor that has more than 4 dimensions.
-inline bool ConnectedToSplitterWithMoreThan4Dims(Layer* baseLayer)
+/// Checks the Layer's Connections to see if it's connected to a Layer with the provided layerType. If dimSize is
+/// provided will also check if the connecting Tensor has more than that number of dimensions
+inline bool ConnectedToLayerType(Layer* baseLayer, LayerType layerType, unsigned int dimSize = 0)
 {
     Layer& parentLayer = baseLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer();
-    TensorInfo parentTensorInfo = baseLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo();
-    if (parentTensorInfo.GetNumDimensions() > 4 && parentLayer.GetType() == LayerType::Splitter)
+    TensorInfo parentTensorInfo = baseLayer->GetInputSlot(0).GetTensorInfo();
+
+    if (parentTensorInfo.GetNumDimensions() > dimSize && parentLayer.GetType() == layerType)
     {
         return true;
     }
@@ -232,7 +234,8 @@
     {
         Layer& nextLayer = baseLayer->GetOutputSlot(0).GetConnection(i)->GetOwningLayer();
         TensorInfo nextTensorInfo = baseLayer->GetOutputSlot(0).GetConnection(i)->GetTensorInfo();
-        if (nextTensorInfo.GetNumDimensions() > 4 && nextLayer.GetType() == LayerType::Splitter)
+
+        if (nextTensorInfo.GetNumDimensions() > dimSize && nextLayer.GetType() == layerType)
         {
             return true;
         }
diff --git a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
index ce1eea4..d8e8f60 100644
--- a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
+++ b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
@@ -54,8 +54,8 @@
         "    edge [fontsize=8 fontcolor=\"blue\" fontname=\"arial-bold\"];\n"
         "    " << inputId << " [label=\"{Input|Guid : " << inputId << "\\lLayerType : Input\\l"
                              "BackendID : CpuRef\\l}\"];\n"
-        "    " << addId << " [label=\"{ElementwiseBinary|Guid : " << addId << "\\lLayerType : ElementwiseBinary\\l"
-                           "BackendID : CpuRef\\l}\"];\n"
+        "    " << addId << " [label=\"{ElementwiseBinary|BinaryOperation : Add\\lGuid : " << addId <<
+                           "\\lLayerType : ElementwiseBinary\\lBackendID : CpuRef\\l}\"];\n"
         "    " << outputId << " [label=\"{Output|Guid : " << outputId << "\\lLayerType : Output\\l"
                               "BackendID : CpuRef\\l}\"];\n"
         "    " << inputId << " -> " << addId << " [label=< [4] >];\n"