diff options
author | Mike Kelly <mike.kelly@arm.com> | 2019-12-13 11:54:00 +0000 |
---|---|---|
committer | Mike Kelly <mike.kelly@arm.com> | 2019-12-13 11:54:00 +0000 |
commit | 358da71e834bb1e66a528a7e7ffd1f97087e17c5 (patch) | |
tree | ac63e17e78758c71c727866fa416f7625bbb5fd4 /1.2/HalPolicy.cpp | |
parent | 784a04bbee7b52d0ea0d9e2c040112c734f31596 (diff) | |
download | android-nn-driver-358da71e834bb1e66a528a7e7ffd1f97087e17c5.tar.gz |
MLCE-144 Disabling NCHW and Float16
* Disabled support for NCHW
* Disabled support for Float16
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I0f5ee8a8ddda1edc7800f167d6a82e4a15c6069b
Diffstat (limited to '1.2/HalPolicy.cpp')
-rw-r--r-- | 1.2/HalPolicy.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/1.2/HalPolicy.cpp b/1.2/HalPolicy.cpp index ed963c4d..3b1200b5 100644 --- a/1.2/HalPolicy.cpp +++ b/1.2/HalPolicy.cpp @@ -172,6 +172,10 @@ bool HalPolicy::ConvertConv2d(const Operation& operation, const Model& model, Co desc.m_DataLayout = OptionalDataLayout<hal_1_2::HalPolicy>(operation, 10, model, data); } + if (desc.m_DataLayout == armnn::DataLayout::NCHW) + { + return Fail("%s: Operation has invalid inputs NCHW is not supported", __func__); + } const armnn::PermutationVector OHWIToOIHW = {0, 2, 3, 1}; // ArmNN does not currently support non-fixed weights or bias @@ -335,6 +339,10 @@ bool HalPolicy::ConvertDepthwiseConv2d(const Operation& operation, const Model& const uint32_t dataLayoutFlagIndex = implicitPadding ? 8 : 11; desc.m_DataLayout = OptionalDataLayout<hal_1_2::HalPolicy>(operation, dataLayoutFlagIndex, model, data); + if (desc.m_DataLayout == armnn::DataLayout::NCHW) + { + return Fail("%s: Operation has invalid inputs NCHW is not supported", __func__); + } armnnUtils::DataLayoutIndexed dataLayoutIndexed(desc.m_DataLayout); unsigned int channelsIndex = dataLayoutIndexed.GetChannelsIndex(); unsigned int widthIndex = dataLayoutIndexed.GetWidthIndex(); @@ -1082,6 +1090,11 @@ bool HalPolicy::ConvertResize(const Operation& operation, descriptor.m_Method = resizeMethod; descriptor.m_DataLayout = OptionalDataLayout<hal_1_2::HalPolicy>(operation, 3, model, data); + if (descriptor.m_DataLayout == armnn::DataLayout::NCHW) + { + return Fail("%s: Operation has invalid inputs NCHW is not supported", __func__); + } + OperandType operandType1; OperandType operandType2; @@ -1214,6 +1227,11 @@ bool HalPolicy::ConvertSpaceToDepth(const Operation& operation, const Model& mod desc.m_DataLayout = OptionalDataLayout<hal_1_2::HalPolicy>(operation, 2, model, data); + if (desc.m_DataLayout == armnn::DataLayout::NCHW) + { + return Fail("%s: Operation has invalid inputs NCHW is not supported", __func__); + } + bool isSupported = false; FORWARD_LAYER_SUPPORT_FUNC(__func__, IsSpaceToDepthSupported, @@ -1809,6 +1827,11 @@ bool HalPolicy::ConvertTransposeConv2d(const Operation& operation, const Model& desc.m_DataLayout = OptionalDataLayout<hal_1_2::HalPolicy>(operation, 10, model, data); } + if (desc.m_DataLayout == armnn::DataLayout::NCHW) + { + return Fail("%s: Operation has invalid inputs NCHW is not supported", __func__); + } + armnnUtils::DataLayoutIndexed dataLayoutIndexed(desc.m_DataLayout); unsigned int widthIndex = dataLayoutIndexed.GetWidthIndex(); unsigned int heightIndex = dataLayoutIndexed.GetHeightIndex(); |