22 std::string explicitInput =
"name: \"Minimal\"\n" 27 " input_param { shape: { dim: 1 dim: 2 dim: 3 dim: 4 } }\n" 29 std::string implicitInput =
"name: \"Minimal\"\n" 35 std::string implicitInputNoShape =
"name: \"Minimal\"\n" 47 network = parser->CreateNetworkFromString(explicitInput.c_str(), {}, {
"data" });
48 BOOST_TEST(network.get());
49 runtime->LoadNetwork(netId,
Optimize(*network, backends, runtime->GetDeviceSpec()));
53 BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first)));
55 BOOST_TEST(inputTensorInfo.
GetShape()[0] == 1);
56 BOOST_TEST(inputTensorInfo.
GetShape()[1] == 2);
57 BOOST_TEST(inputTensorInfo.
GetShape()[2] == 3);
58 BOOST_TEST(inputTensorInfo.
GetShape()[3] == 4);
63 network = parser->CreateNetworkFromString(implicitInput.c_str(), {}, {
"data" });
64 BOOST_TEST(network.get());
65 runtime->LoadNetwork(netId,
Optimize(*network, backends, runtime->GetDeviceSpec()));
69 BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first)));
71 BOOST_TEST(inputTensorInfo.
GetShape()[0] == 1);
72 BOOST_TEST(inputTensorInfo.
GetShape()[1] == 2);
73 BOOST_TEST(inputTensorInfo.
GetShape()[2] == 3);
74 BOOST_TEST(inputTensorInfo.
GetShape()[3] == 4);
79 network = parser->CreateNetworkFromString(implicitInput.c_str(), { {
"data", { 2, 2, 3, 4 } } }, {
"data" });
80 BOOST_TEST(network.get());
81 runtime->LoadNetwork(netId,
Optimize(*network, backends, runtime->GetDeviceSpec()));
85 BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first)));
87 BOOST_TEST(inputTensorInfo.
GetShape()[0] == 2);
88 BOOST_TEST(inputTensorInfo.
GetShape()[1] == 2);
89 BOOST_TEST(inputTensorInfo.
GetShape()[2] == 3);
90 BOOST_TEST(inputTensorInfo.
GetShape()[3] == 4);
95 network = parser->CreateNetworkFromString(implicitInputNoShape.c_str(), {{
"data", {2, 2, 3, 4} }}, {
"data" });
96 BOOST_TEST(network.get());
97 runtime->LoadNetwork(netId,
Optimize(*network, backends, runtime->GetDeviceSpec()));
101 BOOST_TEST((inputTensorInfo == runtime->GetInputTensorInfo(netId, inputBindingInfo.first)));
103 BOOST_TEST(inputTensorInfo.
GetShape()[0] == 2);
104 BOOST_TEST(inputTensorInfo.
GetShape()[1] == 2);
105 BOOST_TEST(inputTensorInfo.
GetShape()[2] == 3);
106 BOOST_TEST(inputTensorInfo.
GetShape()[3] == 4);
111 BOOST_CHECK_THROW(parser->CreateNetworkFromString(implicitInput.c_str(), {{
"data",{ 2, 2, 3, 2 }}}, {
"data"}),
117 BOOST_CHECK_THROW(parser->CreateNetworkFromString(implicitInputNoShape.c_str(), {}, {
"data" }),
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
std::pair< armnn::LayerBindingId, armnn::TensorInfo > BindingPointInfo
std::unique_ptr< ICaffeParser, void(*)(ICaffeParser *parser)> ICaffeParserPtr
static ICaffeParserPtr Create()
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
CPU Execution: Reference C++ kernels.
static IRuntimePtr Create(const CreationOptions &options)
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
const TensorShape & GetShape() const