From 6dd178f2395b34cfb360eabb0130c19ed258f5fa Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 2 Apr 2021 22:04:39 +0100 Subject: IVGCVSW-5720 Remove the Caffe Parser from ArmNN Signed-off-by: Nikhil Raj Change-Id: Ib00be204f549efa9aa5971ecf65c2dec4a10b10f --- src/armnnCaffeParser/test/TestInputs.cpp | 122 ------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 src/armnnCaffeParser/test/TestInputs.cpp (limited to 'src/armnnCaffeParser/test/TestInputs.cpp') diff --git a/src/armnnCaffeParser/test/TestInputs.cpp b/src/armnnCaffeParser/test/TestInputs.cpp deleted file mode 100644 index 96d8e2b8af..0000000000 --- a/src/armnnCaffeParser/test/TestInputs.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// -#include -#include "armnnCaffeParser/ICaffeParser.hpp" -#include "armnn/IRuntime.hpp" -#include "armnn/INetwork.hpp" -#include "armnn/Exceptions.hpp" - -#include "test/TensorHelpers.hpp" - -#include - -#include "ParserPrototxtFixture.hpp" - -BOOST_AUTO_TEST_SUITE(CaffeParser) - - -BOOST_AUTO_TEST_CASE(InputShapes) -{ - std::string explicitInput = "name: \"Minimal\"\n" - "layer {\n" - " name: \"data\"\n" - " type: \"Input\"\n" - " top: \"data\"\n" - " input_param { shape: { dim: 1 dim: 2 dim: 3 dim: 4 } }\n" - "}"; - std::string implicitInput = "name: \"Minimal\"\n" - "input: \"data\" \n" - "input_dim: 1 \n" - "input_dim: 2 \n" - "input_dim: 3 \n" - "input_dim: 4 \n"; - std::string implicitInputNoShape = "name: \"Minimal\"\n" - "input: \"data\" \n"; - - armnn::IRuntime::CreationOptions options; - armnn::IRuntimePtr runtime(armnn::IRuntime::Create(options)); - armnnCaffeParser::ICaffeParserPtr parser(armnnCaffeParser::ICaffeParser::Create()); - armnn::INetworkPtr network(nullptr, nullptr); - armnn::NetworkId netId; - - // Check everything works normally - std::vector backends = {armnn::Compute::CpuRef}; - { - network = parser->CreateNetworkFromString(explicitInput.c_str(), {}, { "data" }); - BOOST_TEST(network.get()); - runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec())); - - armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data"); - armnn::TensorInfo inputTensorInfo = inputBindingInfo.second; - BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first))); - - BOOST_TEST(inputTensorInfo.GetShape()[0] == 1); - BOOST_TEST(inputTensorInfo.GetShape()[1] == 2); - BOOST_TEST(inputTensorInfo.GetShape()[2] == 3); - BOOST_TEST(inputTensorInfo.GetShape()[3] == 4); - } - - // Checks everything works with implicit input. - { - network = parser->CreateNetworkFromString(implicitInput.c_str(), {}, { "data" }); - BOOST_TEST(network.get()); - runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec())); - - armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data"); - armnn::TensorInfo inputTensorInfo = inputBindingInfo.second; - BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first))); - - BOOST_TEST(inputTensorInfo.GetShape()[0] == 1); - BOOST_TEST(inputTensorInfo.GetShape()[1] == 2); - BOOST_TEST(inputTensorInfo.GetShape()[2] == 3); - BOOST_TEST(inputTensorInfo.GetShape()[3] == 4); - } - - // Checks everything works with implicit and passing shape. - { - network = parser->CreateNetworkFromString(implicitInput.c_str(), { {"data", { 2, 2, 3, 4 } } }, { "data" }); - BOOST_TEST(network.get()); - runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec())); - - armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data"); - armnn::TensorInfo inputTensorInfo = inputBindingInfo.second; - BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first))); - - BOOST_TEST(inputTensorInfo.GetShape()[0] == 2); - BOOST_TEST(inputTensorInfo.GetShape()[1] == 2); - BOOST_TEST(inputTensorInfo.GetShape()[2] == 3); - BOOST_TEST(inputTensorInfo.GetShape()[3] == 4); - } - - // Checks everything works with implicit (no shape) and passing shape. - { - network = parser->CreateNetworkFromString(implicitInputNoShape.c_str(), {{"data", {2, 2, 3, 4} }}, { "data" }); - BOOST_TEST(network.get()); - runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec())); - - armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data"); - armnn::TensorInfo inputTensorInfo = inputBindingInfo.second; - BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first))); - - BOOST_TEST(inputTensorInfo.GetShape()[0] == 2); - BOOST_TEST(inputTensorInfo.GetShape()[1] == 2); - BOOST_TEST(inputTensorInfo.GetShape()[2] == 3); - BOOST_TEST(inputTensorInfo.GetShape()[3] == 4); - } - - // Checks exception on incompatible shapes. - { - BOOST_CHECK_THROW(parser->CreateNetworkFromString(implicitInput.c_str(), {{"data",{ 2, 2, 3, 2 }}}, {"data"}), - armnn::ParseException); - } - - // Checks exception when no shape available. - { - BOOST_CHECK_THROW(parser->CreateNetworkFromString(implicitInputNoShape.c_str(), {}, { "data" }), - armnn::ParseException); - } -} - -BOOST_AUTO_TEST_SUITE_END() -- cgit v1.2.1