From 0a99a1469f6ca683df65937ae3ad217b732d01c5 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Fri, 13 Mar 2020 07:52:54 +0000 Subject: IVGCVSW-4531 Fix for failing strided slice NNT/VTS tests on Android R Signed-off-by: David Monahan Change-Id: I7f6932f0d21b5678ab9822b0fc69f589bbbb07e5 --- .../backendsCommon/test/EndToEndTestImpl.hpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/backends/backendsCommon/test/EndToEndTestImpl.hpp') diff --git a/src/backends/backendsCommon/test/EndToEndTestImpl.hpp b/src/backends/backendsCommon/test/EndToEndTestImpl.hpp index 358f4e3fc2..4221f626da 100644 --- a/src/backends/backendsCommon/test/EndToEndTestImpl.hpp +++ b/src/backends/backendsCommon/test/EndToEndTestImpl.hpp @@ -766,4 +766,40 @@ inline void ExportOutputWithSeveralOutputSlotConnectionsTest(std::vector backends) +{ + using namespace armnn; + + // Create runtime in which test will run + IRuntime::CreationOptions options; + IRuntimePtr runtime(armnn::IRuntime::Create(options)); + + // build up the structure of the network + INetworkPtr net(INetwork::Create()); + + IConnectableLayer* input = net->AddInputLayer(0); + + // Configure a strided slice with a stride the same size as the input but with a ShrinkAxisMask on the first + // dim of the output to make it too small to hold the specified slice. + StridedSliceDescriptor descriptor; + descriptor.m_Begin = {0, 0}; + descriptor.m_End = {2, 3}; + descriptor.m_Stride = {1, 1}; + descriptor.m_BeginMask = 0; + descriptor.m_EndMask = 0; + descriptor.m_ShrinkAxisMask = 1; + IConnectableLayer* stridedSlice = net->AddStridedSliceLayer(descriptor); + + IConnectableLayer* output0 = net->AddOutputLayer(0); + + input->GetOutputSlot(0).Connect(stridedSlice->GetInputSlot(0)); + stridedSlice->GetOutputSlot(0).Connect(output0->GetInputSlot(0)); + + input->GetOutputSlot(0).SetTensorInfo(TensorInfo({ 2, 3 }, DataType::Float32)); + stridedSlice->GetOutputSlot(0).SetTensorInfo(TensorInfo({ 3 }, DataType::Float32)); + + // Attempt to optimize the network and check that the correct exception is thrown + BOOST_CHECK_THROW(Optimize(*net, backends, runtime->GetDeviceSpec()), armnn::LayerValidationException); +} + } // anonymous namespace -- cgit v1.2.1