12 #include <boost/test/unit_test.hpp> 19 using namespace armnn;
29 IConnectableLayer* activationLayer = net->AddActivationLayer(descriptor,
"Activation:ReLu");
51 std::vector<BackendId> backends = {
"CpuRef" };
55 BOOST_TEST(runtime->LoadNetwork(netId, std::move(optNet)) ==
Status::Success);
59 std::vector<TensorShape> tensorShapes;
60 std::vector<unsigned int> slotIndexes;
63 boost::ignore_unused(guid);
64 slotIndexes.push_back(slotIndex);
65 tensorShapes.push_back(tensor->GetShape());
69 runtime->RegisterDebugCallback(netId, mockCallback);
71 std::vector<float> inputData({-2, -1, 0, 1, 2});
72 std::vector<float> outputData(5);
76 {0,
ConstTensor(runtime->GetInputTensorInfo(netId, 0), inputData.data())}
80 {0,
Tensor(runtime->GetOutputTensorInfo(netId, 0), outputData.data())}
83 runtime->EnqueueWorkload(netId, inputTensors, outputTensors);
86 BOOST_TEST(callCount == 2);
90 BOOST_TEST(tensorShapes == expectedShapes);
93 const std::vector<unsigned int> expectedSlotIndexes({0, 0});
94 BOOST_TEST(slotIndexes == expectedSlotIndexes);
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)
An ActivationDescriptor for the ActivationLayer.
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
static INetworkPtr Create()
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
static IRuntimePtr Create(const CreationOptions &options)
BOOST_AUTO_TEST_SUITE_END()
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square).
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
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