aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/test/RefEndToEndTests.cpp
diff options
context:
space:
mode:
authorCathal Corbett <cathal.corbett@arm.com>2021-10-08 14:43:11 +0100
committerColm Donelan <colm.donelan@arm.com>2021-10-14 15:03:43 +0000
commitb8cc2b9257640a560fb3e9627a2654acf32dbf8d (patch)
treefdc449ea4b004be047c6480c727499ce1f6b705c /src/backends/reference/test/RefEndToEndTests.cpp
parent4ec6d427f3697b090fed00b07e7c61990bb7ea31 (diff)
downloadarmnn-b8cc2b9257640a560fb3e9627a2654acf32dbf8d.tar.gz
IVGCVSW-6416 AddFullyConnected API crashes without connected weights/bias layers
* Created method in Graph.cpp/hpp ConstructErrorMessageForUnconnectedInputs() to verify weights and bias are set for FullyConnected layers. * Above method called in Graph.cpp InferTensorInfos() to print a more descriptive message when the weights or bias for a FullyConnectedLayer is not set. * Added try-catch in TestUtils.cpp Connect() to ensure input slot is available when connecting two layers. This ensures we catch the case where bias is is not enabled and we try and set a bias layer. * Added unit tests to check for LayerValidationError when weights or bias is not set on a FullyConnectedLayer. * Added unit test to check for LayerValidationError when bias is not enabled and we try and connect bias to FullyConnected Layer. * Seperated FullyConnected EndToEnd unit test method into two methods. First, performs tests on EndToEnd examples asserting output value. Second, performs tests on error catching. * Added comments to created methods. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I5207d8c5ebacfff598556742ccd4f53eef7dee0c
Diffstat (limited to 'src/backends/reference/test/RefEndToEndTests.cpp')
-rw-r--r--src/backends/reference/test/RefEndToEndTests.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/backends/reference/test/RefEndToEndTests.cpp b/src/backends/reference/test/RefEndToEndTests.cpp
index 6c11a75e96..0cc8f4aa10 100644
--- a/src/backends/reference/test/RefEndToEndTests.cpp
+++ b/src/backends/reference/test/RefEndToEndTests.cpp
@@ -618,17 +618,37 @@ TEST_CASE("RefFullyConnectedEndToEndTestFloat32")
TEST_CASE("RefFullyConnectedEndToEndTestNonConstantWeightsConstantBiasesFloat32")
{
- FullyConnectedWithDynamicOrConstantInputsEndToEnd<armnn::DataType::Float32>(defaultBackends, true, true, true);
+ FullyConnectedWithDynamicOrConstantInputsEndToEnd<armnn::DataType::Float32>(defaultBackends, true, true);
}
TEST_CASE("RefFullyConnectedEndToEndTestConstantWeightsNonConstantBiasesFloat32")
{
- FullyConnectedWithDynamicOrConstantInputsEndToEnd<armnn::DataType::Float32>(defaultBackends, true, false, true);
+ FullyConnectedWithDynamicOrConstantInputsEndToEnd<armnn::DataType::Float32>(defaultBackends, true, false);
}
TEST_CASE("RefFullyConnectedEndToEndTestConstantWeightsTensorInfoNotSet")
{
- FullyConnectedWithDynamicOrConstantInputsEndToEnd<armnn::DataType::Float32>(defaultBackends, true, false, false);
+ FullyConnectedErrorChecking<armnn::DataType::Float32>(defaultBackends, false, true, true, true, false);
+}
+
+TEST_CASE("RefFullyConnectedEndToEndTestWeightsNotConnectedExplicitCheck")
+{
+ FullyConnectedErrorChecking<armnn::DataType::Float32>(defaultBackends, true, true, false, true, true);
+}
+
+TEST_CASE("RefFullyConnectedEndToEndTestBiasNotConnectedExplicitCheck")
+{
+ FullyConnectedErrorChecking<armnn::DataType::Float32>(defaultBackends, true, true, true, false, true);
+}
+
+TEST_CASE("RefFullyConnectedEndToEndTestWeightsAndBiasNotConnected")
+{
+ FullyConnectedErrorChecking<armnn::DataType::Float32>(defaultBackends, false, true, false, false, true);
+}
+
+TEST_CASE("RefFullyConnectedEndToEndTestBiasDisabledConnectBias")
+{
+ FullyConnectedErrorChecking<armnn::DataType::Float32>(defaultBackends, true, false, false, true, true);
}
TEST_CASE("RefGatherFloatTest")