ArmNN
 20.02
DepthToSpaceEndToEndTestImpl.hpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType>
void DepthToSpaceEndToEnd (const std::vector< armnn::BackendId > &defaultBackends, armnn::DataLayout dataLayout)
 

Function Documentation

◆ DepthToSpaceEndToEnd()

void DepthToSpaceEndToEnd ( const std::vector< armnn::BackendId > &  defaultBackends,
armnn::DataLayout  dataLayout 
)

Definition at line 81 of file DepthToSpaceEndToEndTestImpl.hpp.

References defaultBackends.

83 {
84  using namespace armnn;
85 
86  TensorShape inputShape = { 2, 2, 2, 4 };
87  TensorShape outputShape = { 2, 4, 4, 1 };
88 
89  std::vector<float> inputData =
90  {
91  1.f, 2.f, 3.f, 4.f,
92  5.f, 6.f, 7.f, 8.f,
93  9.f, 10.f, 11.f, 12.f,
94  13.f, 14.f, 15.f, 16.f,
95 
96  17.f, 18.f, 19.f, 20.f,
97  21.f, 22.f, 23.f, 24.f,
98  25.f, 26.f, 27.f, 28.f,
99  29.f, 30.f, 31.f, 32.f
100  };
101 
102  std::vector<float> expectedOutputData =
103  {
104  1.f, 2.f, 5.f, 6.f,
105  3.f, 4.f, 7.f, 8.f,
106  9.f, 10.f, 13.f, 14.f,
107  11.f, 12.f, 15.f, 16.f,
108 
109  17.f, 18.f, 21.f, 22.f,
110  19.f, 20.f, 23.f, 24.f,
111  25.f, 26.f, 29.f, 30.f,
112  27.f, 28.f, 31.f, 32.f
113  };
114 
115  DepthToSpaceEndToEndImpl<ArmnnType>(defaultBackends,
116  DepthToSpaceDescriptor(2, dataLayout),
117  inputShape,
118  outputShape,
119  inputData,
120  expectedOutputData);
121 }
Copyright (c) 2020 ARM Limited.
std::vector< armnn::BackendId > defaultBackends
SpaceToDepthDescriptor DepthToSpaceDescriptor
A DepthToSpaceDescriptor for the DepthToSpaceLayer.