13 #include <boost/test/unit_test.hpp> 17 using namespace armnn;
34 layerDesc.
m_Eps = 0.05f;
38 layer->
m_Mean = std::make_unique<ScopedTensorHandle>(weightInfo);
39 layer->
m_Variance = std::make_unique<ScopedTensorHandle>(weightInfo);
40 layer->
m_Beta = std::make_unique<ScopedTensorHandle>(weightInfo);
41 layer->
m_Gamma = std::make_unique<ScopedTensorHandle>(weightInfo);
53 Connect(input, layer, tensorInfo);
54 Connect(layer, output, tensorInfo);
57 BOOST_CHECK(layer->
m_Mean !=
nullptr);
59 BOOST_CHECK(layer->
m_Beta !=
nullptr);
60 BOOST_CHECK(layer->
m_Gamma !=
nullptr);
66 BOOST_CHECK(layer->
m_Mean ==
nullptr);
68 BOOST_CHECK(layer->
m_Beta ==
nullptr);
69 BOOST_CHECK(layer->
m_Gamma ==
nullptr);
92 layer->
m_Bias = std::make_unique<ScopedTensorHandle>
107 BOOST_CHECK(layer->
m_Weight !=
nullptr);
108 BOOST_CHECK(layer->
m_Bias !=
nullptr);
114 BOOST_CHECK(layer->
m_Weight ==
nullptr);
115 BOOST_CHECK(layer->
m_Bias ==
nullptr);
137 layer->
m_Bias->Allocate();
148 BOOST_CHECK(layer->
m_Weight !=
nullptr);
149 BOOST_CHECK(layer->
m_Bias !=
nullptr);
155 BOOST_CHECK(layer->
m_Weight ==
nullptr);
156 BOOST_CHECK(layer->
m_Bias ==
nullptr);
170 float inputsQScale = 1.0f;
171 float outputQScale = 2.0f;
178 layer->
m_Bias->Allocate();
189 BOOST_CHECK(layer->
m_Weight !=
nullptr);
190 BOOST_CHECK(layer->
m_Bias !=
nullptr);
196 BOOST_CHECK(layer->
m_Weight ==
nullptr);
197 BOOST_CHECK(layer->
m_Bias ==
nullptr);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
virtual void ReleaseConstantData()
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
This layer represents a batch normalization operation.
bool m_BiasEnabled
Enable/disable bias.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
This layer represents a depthwise convolution 2d operation.
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
A Convolution2dDescriptor for the Convolution2dLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
float m_Eps
Value to add to the variance. Used to avoid dividing by zero.
std::shared_ptr< ConstTensorHandle > m_Weight
A unique pointer to store Weight values.
std::shared_ptr< ConstTensorHandle > m_Mean
A unique pointer to store Mean values.
uint32_t m_PadRight
Padding right value in the width dimension.
Copyright (c) 2021 ARM Limited and Contributors.
std::shared_ptr< ConstTensorHandle > m_Beta
A unique pointer to store Beta values.
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
A layer user-provided data can be bound to (e.g. inputs, outputs).
This layer represents a fully connected operation.
std::shared_ptr< ConstTensorHandle > m_Weight
A unique pointer to store Weight values.
uint32_t m_PadTop
Padding top value in the height dimension.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool m_BiasEnabled
Enable/disable bias.
std::shared_ptr< ConstTensorHandle > m_Bias
A unique pointer to store Bias values.
std::shared_ptr< ConstTensorHandle > m_Gamma
A unique pointer to store Gamma values.
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
std::shared_ptr< ConstTensorHandle > m_Variance
A unique pointer to store Variance values.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
std::shared_ptr< ConstTensorHandle > m_Bias
A unique pointer to store Bias values.
DataType GetBiasDataType(DataType inputDataType)
BOOST_AUTO_TEST_SUITE_END()
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
std::shared_ptr< ConstTensorHandle > m_Bias
A unique pointer to store Bias values.
std::shared_ptr< ConstTensorHandle > m_Weight
A unique pointer to store Weight values.
This layer represents a convolution 2d operation.
void Connect(armnn::IConnectableLayer *from, armnn::IConnectableLayer *to, const armnn::TensorInfo &tensorInfo, unsigned int fromIndex, unsigned int toIndex)
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
uint32_t m_PadRight
Padding right value in the width dimension.