Syntax change to allow building on older compilers (ReduceLayer)

Signed-off-by: Kevin May <kevin.may@arm.com>
Change-Id: If02101d881bb7c937e858e464a043d849ac40ba9
diff --git a/src/armnn/layers/ReduceLayer.cpp b/src/armnn/layers/ReduceLayer.cpp
index bebd043..9fbbc39 100644
--- a/src/armnn/layers/ReduceLayer.cpp
+++ b/src/armnn/layers/ReduceLayer.cpp
@@ -51,7 +51,8 @@
 
     const TensorInfo& input = GetInputSlot(0).GetTensorInfo();
 
-    if (auto inputDims = input.GetNumDimensions(); inputDims != std::clamp(inputDims, 1u, 4u))
+    auto inputDims = input.GetNumDimensions();
+    if (inputDims != std::clamp(inputDims, 1u, 4u))
     {
         throw armnn::LayerValidationException("ReduceLayer: Reduce supports up to 4D input.");
     }
@@ -71,7 +72,8 @@
 
     const TensorShape& input = inputShapes[0];
 
-    if (auto inputDims = input.GetNumDimensions(); inputDims != std::clamp(inputDims, 1u, 4u))
+    auto inputDims = input.GetNumDimensions();
+    if (inputDims != std::clamp(inputDims, 1u, 4u))
     {
         throw armnn::Exception("ReduceLayer: Reduce supports up to 4D input.");
     }