15 #include <boost/core/ignore_unused.hpp> 16 #include <boost/test/unit_test.hpp> 20 using namespace armnn;
36 inputLayer2->GetOutputSlot(0).Connect(additionLayer->GetInputSlot(1));
37 additionLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
40 inputLayer2->GetOutputSlot().SetTensorInfo(fp16TensorInfo);
41 additionLayer->GetOutputSlot().SetTensorInfo(fp16TensorInfo);
50 using namespace half_float::literal;
79 runtime->LoadNetwork(netId, std::move(optNet));
81 std::vector<Half> input1Data
83 1.0_h, 2.0_h, 3.0_h, 4.0_h
86 std::vector<Half> input2Data
88 100.0_h, 200.0_h, 300.0_h, 400.0_h
93 {0,
ConstTensor(runtime->GetInputTensorInfo(netId, 0), input1Data.data())},
94 {1,
ConstTensor(runtime->GetInputTensorInfo(netId, 0), input2Data.data())}
97 std::vector<Half> outputData(input1Data.size());
100 {0,
Tensor(runtime->GetOutputTensorInfo(netId, 0), outputData.data())}
104 runtime->EnqueueWorkload(netId, inputTensors, outputTensors);
107 BOOST_TEST(outputData == std::vector<Half>({ 101.0_h, 202.0_h, 303.0_h, 404.0_h}));
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
std::vector< std::pair< LayerBindingId, class Tensor > > OutputTensors
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
int Connect(InputSlot &destination)
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
void SetTensorInfo(const TensorInfo &tensorInfo) override
static INetworkPtr Create()
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
A layer user-provided data can be bound to (e.g. inputs, outputs).
GPU Execution: OpenCL: ArmCompute.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
static IRuntimePtr Create(const CreationOptions &options)
BOOST_AUTO_TEST_SUITE_END()
This layer represents an addition operation.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
DataType GetDataType() const
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
virtual int Connect(IInputSlot &destination)=0
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
const TensorInfo & GetTensorInfo() const override
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0