11 #include <boost/test/unit_test.hpp> 45 layer = net->AddActivationLayer(acDesc,
"ac");
51 layer = net->AddMultiplicationLayer(
"ml");
59 layer = net->AddSoftmaxLayer(softmaxDescriptor,
"sm");
65 layer = net->AddOutputLayer(0,
"ot");
80 for (
auto&& layer : graph)
82 BOOST_CHECK_NO_THROW(layer->CreateWorkload(fact));
105 permute->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
116 for (
auto&& layer : graph)
141 meanLayer->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
150 for (
auto&& layer : graph)
163 activation1Descriptor.
m_A = 1.f;
164 activation1Descriptor.
m_B = -1.f;
167 auto input = net->AddInputLayer(0,
"InputLayer");
168 auto activation = net->AddActivationLayer(activation1Descriptor,
"ActivationLayer");
169 auto output = net->AddOutputLayer(0,
"OutputLayer");
172 input->GetOutputSlot(0).Connect(activation->GetInputSlot(0));
173 activation->GetOutputSlot(0).Connect(output->GetInputSlot(0));
177 input->GetOutputSlot(0).SetTensorInfo(info);
178 activation->GetOutputSlot(0).SetTensorInfo(info);
186 optimizerOptions.
m_Debug =
true;
195 BOOST_TEST(graph.GetNumLayers() == 5);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
static IRuntimePtr Create(const CreationOptions &options)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
CPU Execution: Reference C++ kernels.
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
bool GraphHasNamedLayer(const armnn::Graph &graph, const std::string &name)
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
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.
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
An ActivationDescriptor for the ActivationLayer.
min(a, max(b, input)) ReLu1 & ReLu6.
BOOST_AUTO_TEST_CASE(OptimizeValidateCpuRefWorkloads)
Graph & GetGraphForTesting(IOptimizedNetwork *optNet)
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
BOOST_AUTO_TEST_SUITE_END()
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
A MeanDescriptor for the MeanLayer.
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
A NormalizationDescriptor for the NormalizationLayer.
Status AllocateDynamicBuffers()
Allocates memory for all tensors under output tensor handers of each layer.
static INetworkPtr Create(NetworkOptions networkOptions={})
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
A SoftmaxDescriptor for the SoftmaxLayer.
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
A PermuteDescriptor for the PermuteLayer.