19 using namespace armnn;
29 IConnectableLayer* activationLayer = net->AddActivationLayer(descriptor,
"Activation:ReLu");
42 TEST_CASE(
"RuntimeRegisterDebugCallback")
51 std::vector<BackendId> backends = {
"CpuRef" };
55 CHECK(runtime->LoadNetwork(netId, std::move(optNet)) ==
Status::Success);
59 std::vector<TensorShape> tensorShapes;
60 std::vector<unsigned int> slotIndexes;
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 CHECK(callCount == 2);
90 CHECK(tensorShapes == expectedShapes);
93 const std::vector<unsigned int> expectedSlotIndexes({0, 0});
94 CHECK(slotIndexes == expectedSlotIndexes);
static IRuntimePtr Create(const CreationOptions &options)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
Create an optimized version of the network.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
std::vector< std::pair< LayerBindingId, class Tensor > > OutputTensors
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
An ActivationDescriptor for the ActivationLayer.
profiling::ProfilingGuid LayerGuid
Define LayerGuid type.
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
virtual int Connect(IInputSlot &destination)=0
static INetworkPtr Create(NetworkOptions networkOptions={})
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).