28 TEST_CASE(
"ReleaseBatchNormalizationLayerConstantDataTest")
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 CHECK(layer->
m_Mean !=
nullptr);
59 CHECK(layer->
m_Beta !=
nullptr);
60 CHECK(layer->
m_Gamma !=
nullptr);
66 CHECK(layer->
m_Mean ==
nullptr);
68 CHECK(layer->
m_Beta ==
nullptr);
69 CHECK(layer->
m_Gamma ==
nullptr);
74 TEST_CASE(
"ReleaseConvolution2dLayerConstantDataTest")
92 layer->
m_Bias = std::make_unique<ScopedTensorHandle>
108 CHECK(layer->
m_Bias !=
nullptr);
115 CHECK(layer->
m_Bias ==
nullptr);
118 TEST_CASE(
"ReleaseDepthwiseConvolution2dLayerConstantDataTest")
134 layer->
m_Weight = std::make_unique<ScopedTensorHandle>(
TensorInfo({3, 3, 5, 3}, DataType::Float32));
135 layer->
m_Bias = std::make_unique<ScopedTensorHandle>(
TensorInfo({9}, DataType::Float32));
137 layer->
m_Bias->Allocate();
149 CHECK(layer->
m_Bias !=
nullptr);
156 CHECK(layer->
m_Bias ==
nullptr);
159 TEST_CASE(
"ReleaseFullyConnectedLayerConstantDataTest")
170 float inputsQScale = 1.0f;
171 float outputQScale = 2.0f;
174 DataType::QAsymmU8, inputsQScale, 0));
178 layer->
m_Bias->Allocate();
185 Connect(input, layer,
TensorInfo({3, 1, 4, 5}, DataType::QAsymmU8, inputsQScale));
190 CHECK(layer->
m_Bias !=
nullptr);
197 CHECK(layer->
m_Bias ==
nullptr);
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.
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.
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)
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.