aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/ReshapeLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn/layers/ReshapeLayer.cpp')
-rw-r--r--src/armnn/layers/ReshapeLayer.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/armnn/layers/ReshapeLayer.cpp b/src/armnn/layers/ReshapeLayer.cpp
index 0257ca9b15..3f955a57b0 100644
--- a/src/armnn/layers/ReshapeLayer.cpp
+++ b/src/armnn/layers/ReshapeLayer.cpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017 Arm Ltd. All rights reserved.
+// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include "ReshapeLayer.hpp"
@@ -38,18 +38,17 @@ std::vector<TensorShape> ReshapeLayer::InferOutputShapes(const std::vector<Tenso
void ReshapeLayer::ValidateTensorShapesFromInputs(ShapeInferenceMethod shapeInferenceMethod)
{
- IgnoreUnused(shapeInferenceMethod);
-
VerifyLayerConnections(1, CHECK_LOCATION());
- auto inferredShapes = InferOutputShapes({ });
+ const TensorShape& outputShape = GetOutputSlot(0).GetTensorInfo().GetShape();
+
+ VerifyShapeInferenceType(outputShape, shapeInferenceMethod);
+
+ auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() });
ARMNN_ASSERT(inferredShapes.size() == 1);
- ConditionalThrowIfNotEqual<LayerValidationException>(
- "ReshapeLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
- GetOutputSlot(0).GetTensorInfo().GetShape(),
- inferredShapes[0]);
+ ValidateAndCopyShape(outputShape, inferredShapes[0], shapeInferenceMethod, "ReshapeLayer");
}
void ReshapeLayer::Accept(ILayerVisitor& visitor) const