12 #include <boost/test/unit_test.hpp> 27 input->GetOutputSlot(0).Connect(add->GetInputSlot(1));
28 add->GetOutputSlot(0).Connect(output->GetInputSlot(0));
32 input->GetOutputSlot(0).SetTensorInfo(info);
33 add->GetOutputSlot(0).SetTensorInfo(info);
41 std::ostringstream ss;
42 optimizedNet->SerializeToDot(ss);
44 auto inputId = input->GetGuid();
45 auto addId = add->GetGuid();
46 auto outputId = output->GetGuid();
48 std::stringstream expected;
50 "digraph Optimized {\n" 51 " node [shape=\"record\"];\n" 52 " edge [fontsize=8 fontcolor=\"blue\" fontname=\"arial-bold\"];\n" 53 " " << inputId <<
" [label=\"{Input|LayerType : Input\\lBackendID : CpuRef\\l}\"];\n" 54 " " << addId <<
" [label=\"{Addition|LayerType : Addition\\lBackendID : CpuRef\\l}\"];\n" 55 " " << outputId <<
" [label=\"{Output|LayerType : Output\\lBackendID : CpuRef\\l}\"];\n" 56 " " << inputId <<
" -> " << addId <<
" [label=< [4] >];\n" 57 " " << inputId <<
" -> " << addId <<
" [label=< [4] >];\n" 58 " " << addId <<
" -> " << outputId <<
" [label=< [4] >];\n" 61 BOOST_TEST(ss.str() == expected.str());
115 BOOST_REQUIRE(optNet);
117 for (
auto&& layer : static_cast<armnn::OptimizedNetwork*>(optNet.get())->GetGraph())
122 #if defined(ARMCOMPUTENEON_ENABLED) 165 layer = net.AddActivationLayer(acDesc,
"ac");
171 layer = net.AddMultiplicationLayer(
"ml");
179 layer = net.AddSoftmaxLayer(softmaxDescriptor,
"sm");
185 layer = net.AddOutputLayer(0,
"ot");
227 layer = net.AddActivationLayer(acDesc,
"ac");
233 layer = net.AddMultiplicationLayer(
"ml");
241 layer = net.AddSoftmaxLayer(softmaxDescriptor,
"sm");
247 layer = net.AddOutputLayer(0,
"ot");
261 for (
auto&& layer : static_cast<armnn::OptimizedNetwork*>(optNet.get())->GetGraph())
264 BOOST_CHECK_NO_THROW(
265 layer->CreateWorkload(fact));
296 BOOST_REQUIRE(optNet);
298 for (
auto&& layer : static_cast<armnn::OptimizedNetwork*>(optNet.get())->GetGraph())
305 #if defined(ARMCOMPUTENEON_ENABLED) 314 #elif defined(ARMCOMPUTECL_ENABLED)
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
A NormalizationDescriptor for the NormalizationLayer.
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr) override
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
An ActivationDescriptor for the ActivationLayer.
IConnectableLayer * AddAdditionLayer(const char *name=nullptr) override
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
Private implementation of INetwork.
static INetworkPtr Create()
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
GPU Execution: OpenCL: ArmCompute.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
CPU Execution: Reference C++ kernels.
static IRuntimePtr Create(const CreationOptions &options)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(SerializeToDot)
A SoftmaxDescriptor for the SoftmaxLayer.
CPU Execution: NEON: ArmCompute.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr) override
virtual int Connect(IInputSlot &destination)=0
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0