aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn/layers')
-rw-r--r--src/armnn/layers/BatchToSpaceNdLayer.cpp3
-rw-r--r--src/armnn/layers/Convolution2dLayer.cpp1
-rw-r--r--src/armnn/layers/DepthwiseConvolution2dLayer.cpp1
-rw-r--r--src/armnn/layers/Pooling2dLayer.cpp8
-rw-r--r--src/armnn/layers/ResizeBilinearLayer.cpp5
-rw-r--r--src/armnn/layers/SpaceToBatchNdLayer.cpp6
6 files changed, 16 insertions, 8 deletions
diff --git a/src/armnn/layers/BatchToSpaceNdLayer.cpp b/src/armnn/layers/BatchToSpaceNdLayer.cpp
index aff818e664..e1b78b21df 100644
--- a/src/armnn/layers/BatchToSpaceNdLayer.cpp
+++ b/src/armnn/layers/BatchToSpaceNdLayer.cpp
@@ -10,6 +10,7 @@
#include <armnn/TypesUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
+#include <backendsCommon/DataLayoutIndexed.hpp>
#include <backendsCommon/WorkloadData.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
@@ -50,7 +51,7 @@ void BatchToSpaceNdLayer::ValidateTensorShapesFromInputs()
std::vector<TensorShape> BatchToSpaceNdLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const
{
- const DataLayoutIndexed & dataLayout = m_Param.m_DataLayout;
+ const DataLayoutIndexed dataLayout = m_Param.m_DataLayout;
const TensorShape& inputShape = inputShapes[0];
unsigned int inBatchSize = inputShape[0];
unsigned int channelSize = inputShape[dataLayout.GetChannelsIndex()];
diff --git a/src/armnn/layers/Convolution2dLayer.cpp b/src/armnn/layers/Convolution2dLayer.cpp
index f3597e2914..4d3553f0cc 100644
--- a/src/armnn/layers/Convolution2dLayer.cpp
+++ b/src/armnn/layers/Convolution2dLayer.cpp
@@ -8,6 +8,7 @@
#include <armnn/TypesUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
+#include <backendsCommon/DataLayoutIndexed.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
namespace armnn
diff --git a/src/armnn/layers/DepthwiseConvolution2dLayer.cpp b/src/armnn/layers/DepthwiseConvolution2dLayer.cpp
index f356e39335..6ad32a756a 100644
--- a/src/armnn/layers/DepthwiseConvolution2dLayer.cpp
+++ b/src/armnn/layers/DepthwiseConvolution2dLayer.cpp
@@ -8,6 +8,7 @@
#include <armnn/TypesUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
+#include <backendsCommon/DataLayoutIndexed.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
namespace armnn
diff --git a/src/armnn/layers/Pooling2dLayer.cpp b/src/armnn/layers/Pooling2dLayer.cpp
index 821c011cd0..24b7a69c49 100644
--- a/src/armnn/layers/Pooling2dLayer.cpp
+++ b/src/armnn/layers/Pooling2dLayer.cpp
@@ -7,6 +7,7 @@
#include "LayerCloneBase.hpp"
#include <armnn/TypesUtils.hpp>
+#include <backendsCommon/DataLayoutIndexed.hpp>
#include <backendsCommon/WorkloadData.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
@@ -33,13 +34,14 @@ std::vector<TensorShape> Pooling2dLayer::InferOutputShapes(const std::vector<Ten
{
BOOST_ASSERT(inputShapes.size() == 1);
const TensorShape& inputShape = inputShapes[0];
+ const DataLayoutIndexed dimensionIndices = m_Param.m_DataLayout;
// If we support multiple batch dimensions in the future, then this assert will need to change.
BOOST_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Pooling2dLayer will always have 4D input.");
- unsigned int inWidth = inputShape[m_Param.m_DataLayout.GetWidthIndex()];
- unsigned int inHeight = inputShape[m_Param.m_DataLayout.GetHeightIndex()];
- unsigned int inChannels = inputShape[m_Param.m_DataLayout.GetChannelsIndex()];
+ unsigned int inWidth = inputShape[dimensionIndices.GetWidthIndex()];
+ unsigned int inHeight = inputShape[dimensionIndices.GetHeightIndex()];
+ unsigned int inChannels = inputShape[dimensionIndices.GetChannelsIndex()];
unsigned int inBatchSize = inputShape[0];
bool isGlobalPooling = (m_Param.m_StrideX==0 && m_Param.m_StrideY==0);
diff --git a/src/armnn/layers/ResizeBilinearLayer.cpp b/src/armnn/layers/ResizeBilinearLayer.cpp
index 69ce69eea5..f72ccfce90 100644
--- a/src/armnn/layers/ResizeBilinearLayer.cpp
+++ b/src/armnn/layers/ResizeBilinearLayer.cpp
@@ -7,6 +7,7 @@
#include "LayerCloneBase.hpp"
#include <armnn/TypesUtils.hpp>
+#include <backendsCommon/DataLayoutIndexed.hpp>
#include <backendsCommon/WorkloadData.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
@@ -34,10 +35,10 @@ std::vector<TensorShape> ResizeBilinearLayer::InferOutputShapes(const std::vecto
{
BOOST_ASSERT(inputShapes.size() == 1);
const TensorShape& inputShape = inputShapes[0];
-
+ const DataLayoutIndexed dimensionIndices = m_Param.m_DataLayout;
unsigned int outWidth = m_Param.m_TargetWidth;
unsigned int outHeight = m_Param.m_TargetHeight;
- unsigned int outChannels = inputShape[m_Param.m_DataLayout.GetChannelsIndex()];
+ unsigned int outChannels = inputShape[dimensionIndices.GetChannelsIndex()];
unsigned int outBatch = inputShape[0];
TensorShape tensorShape = m_Param.m_DataLayout == armnn::DataLayout::NHWC ?
diff --git a/src/armnn/layers/SpaceToBatchNdLayer.cpp b/src/armnn/layers/SpaceToBatchNdLayer.cpp
index cc93886e50..658945ef08 100644
--- a/src/armnn/layers/SpaceToBatchNdLayer.cpp
+++ b/src/armnn/layers/SpaceToBatchNdLayer.cpp
@@ -9,6 +9,7 @@
#include <armnn/TypesUtils.hpp>
+#include <backendsCommon/DataLayoutIndexed.hpp>
#include <backendsCommon/WorkloadData.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
@@ -48,8 +49,9 @@ std::vector<TensorShape> SpaceToBatchNdLayer::InferOutputShapes(const std::vecto
1U,
std::multiplies<>());
- unsigned int heightIndex = m_Param.m_DataLayout.GetHeightIndex();
- unsigned int widthIndex = m_Param.m_DataLayout.GetWidthIndex();
+ DataLayoutIndexed dimensionIndices = m_Param.m_DataLayout;
+ unsigned int heightIndex = dimensionIndices.GetHeightIndex();
+ unsigned int widthIndex = dimensionIndices.GetWidthIndex();
std::pair<unsigned int, unsigned int> heightPad = m_Param.m_PadList[0];
std::pair<unsigned int, unsigned int> widthPad = m_Param.m_PadList[1];