ArmNN
 20.02
DepthwiseConvolution2D.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "ParserFlatbuffersFixture.hpp"
#include "../TfLiteParser.hpp"
#include <string>
#include <iostream>

Go to the source code of this file.

Functions

 BOOST_FIXTURE_TEST_CASE (ParseDepthwiseConv2DSame, DepthwiseConvolution2dSameFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseDepthwiseConv2DValid, DepthwiseConvolution2dValidFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseDepthwiseConv2DSameBias, DepthwiseConvolution2dSameBiasFixture)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/3]

BOOST_FIXTURE_TEST_CASE ( ParseDepthwiseConv2DSame  ,
DepthwiseConvolution2dSameFixture   
)

Definition at line 134 of file DepthwiseConvolution2D.cpp.

135 {
136  RunTest<4, armnn::DataType::QAsymmU8>(
137  0,
138  { 0, 1, 2,
139  3, 4, 5,
140  6, 7, 8 },
141  // the expected values were generated using the example python implementation at
142  // https://eli.thegreenplace.net/2018/depthwise-separable-convolutions-for-machine-learning/
143  // divide the expected values by the output scale, as it is not 1.0
144  { 14/2, 35/2, 38/2,
145  57/2, 120/2, 111/2,
146  110/2, 197/2, 158/2 });
147 }

◆ BOOST_FIXTURE_TEST_CASE() [2/3]

BOOST_FIXTURE_TEST_CASE ( ParseDepthwiseConv2DValid  ,
DepthwiseConvolution2dValidFixture   
)

Definition at line 161 of file DepthwiseConvolution2D.cpp.

162 {
163  RunTest<4, armnn::DataType::QAsymmU8>(
164  0,
165  { 0, 1, 2,
166  3, 4, 5,
167  6, 7, 8 },
168  // divide the expected values by the output scale, as it is not 1.0
169  { 120/2 });
170 }

◆ BOOST_FIXTURE_TEST_CASE() [3/3]

BOOST_FIXTURE_TEST_CASE ( ParseDepthwiseConv2DSameBias  ,
DepthwiseConvolution2dSameBiasFixture   
)

Definition at line 186 of file DepthwiseConvolution2D.cpp.

References BOOST_AUTO_TEST_SUITE_END().

187 {
188  RunTest<4, armnn::DataType::QAsymmU8>(
189  0,
190  { 0, 1, 2,
191  3, 4, 5,
192  6, 7, 8 },
193  // divide the expected values by the output scale, as it is not 1.0
194  { ( 14+10)/2, ( 35+10)/2, ( 38+10)/2,
195  ( 57+10)/2, (120+10)/2, (111+10)/2,
196  (110+10)/2, (197+10)/2, (158+10)/2 });
197 }