ArmNN
 21.11
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 82 of file DepthToSpaceEndToEndTestImpl.hpp.

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