aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2020-03-17 14:25:57 +0000
committerJim Flynn <jim.flynn@arm.com>2020-03-17 19:37:42 +0000
commitf4a953f75b751452ae9303abc8565d310c55bfff (patch)
treeab766818452fe45b4f959edd2bf128124092ce12 /src/armnnTfLiteParser
parent5c391dcdc3dd2c4e0f246be3eeb7a089d3c9323d (diff)
downloadarmnn-f4a953f75b751452ae9303abc8565d310c55bfff.tar.gz
IVGCVSW-4545 Relax check on ParseReshape
Change-Id: Icae7c40abb307e1bbdd383ab3f835f5a1bee2db1 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/armnnTfLiteParser')
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp
index fc5041bf9a..a0c673a5ad 100644
--- a/src/armnnTfLiteParser/TfLiteParser.cpp
+++ b/src/armnnTfLiteParser/TfLiteParser.cpp
@@ -1944,12 +1944,6 @@ void TfLiteParser::ParseReshape(size_t subgraphIndex, size_t operatorIndex)
std::vector<int32_t> targetShape;
if (inputs.size() > 1 && inputs[1] != nullptr)
{
- if (options != nullptr)
- {
- ARMNN_THROW_PARSE_EXCEPTION("Target shape defined in reshape parameters and input tensor. "
- "Only one method expected");
- }
-
if (inputs[1]->is_variable)
{
ARMNN_THROW_PARSE_EXCEPTION( "Target shapes defined in non-const input tensors is not supported");
@@ -1971,6 +1965,14 @@ void TfLiteParser::ParseReshape(size_t subgraphIndex, size_t operatorIndex)
{
targetShape.push_back(vals[i]);
}
+
+ if (options != nullptr &&
+ options->new_shape.empty() == false &&
+ options->new_shape != targetShape)
+ {
+ ARMNN_THROW_PARSE_EXCEPTION("Target shape defined in reshape parameters and as input tensor but "
+ "the values do not match");
+ }
}
else
{