aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/ResizeBilinearLayer.cpp
diff options
context:
space:
mode:
authornarpra01 <narumol.prangnawarat@arm.com>2018-10-26 17:36:32 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-27 21:50:38 +0000
commit7af7688a77e9fe2929a626f7c7dab9aef089d2b3 (patch)
tree70ab471953ee151107b411588a515a25ca845b97 /src/armnn/layers/ResizeBilinearLayer.cpp
parentf98d21a244c384c5942e4b261d168f65ecc8a797 (diff)
downloadarmnn-7af7688a77e9fe2929a626f7c7dab9aef089d2b3.tar.gz
IVGCVSW-2083 - Add DataLayout parameter to calculate the expected output shape in ValidateTensorShapesFromInputs
* Convolution2dLayer * DepthwiseConvolution2dLayer * Pooling2dLayer * ResizeBilinearLayer * Unittests for ValidateTensorShapesFromInputs Change-Id: I057caf8a90d822175a7dd7271f960b65c6154bb4
Diffstat (limited to 'src/armnn/layers/ResizeBilinearLayer.cpp')
-rw-r--r--src/armnn/layers/ResizeBilinearLayer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/armnn/layers/ResizeBilinearLayer.cpp b/src/armnn/layers/ResizeBilinearLayer.cpp
index 9f0608d11c..fda93da99f 100644
--- a/src/armnn/layers/ResizeBilinearLayer.cpp
+++ b/src/armnn/layers/ResizeBilinearLayer.cpp
@@ -37,10 +37,14 @@ std::vector<TensorShape> ResizeBilinearLayer::InferOutputShapes(const std::vecto
unsigned int outWidth = m_Param.m_TargetWidth;
unsigned int outHeight = m_Param.m_TargetHeight;
- unsigned int outChannels = inputShape[1];
+ unsigned int outChannels = inputShape[m_Param.m_DataLayout.GetChannelsIndex()];
unsigned int outBatch = inputShape[0];
- return std::vector<TensorShape>({ TensorShape({outBatch, outChannels, outHeight, outWidth}) });
+ TensorShape tensorShape = m_Param.m_DataLayout == armnn::DataLayout::NHWC ?
+ TensorShape( { outBatch, outHeight, outWidth, outChannels } ) :
+ TensorShape( { outBatch, outChannels, outHeight, outWidth });
+
+ return std::vector<TensorShape>({ tensorShape });
}
void ResizeBilinearLayer::ValidateTensorShapesFromInputs()