MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / TEST_CASE

Function TEST_CASE

tests/validation/NEON/Pooling3dLayer.cpp:112–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110TEST_SUITE(Pooling3dLayer)
111
112TEST_CASE(SimpleIntegerAvgPooling, framework::DatasetMode::ALL)
113{
114 const auto pool_info =
115 Pooling3dLayerInfo(PoolingType::AVG, Size3D(1, 1, 1), Size3D(1, 1, 1), Padding3D(), true /* exclude padding */);
116 const auto shape = TensorShape(18U, 1U, 1U, 1U); // > 16 for channel dim. to stress vector and leftover loops
117 const auto dtype = DataType::QASYMM8_SIGNED;
118 const auto layout = DataLayout::NDHWC;
119 const auto qinfo = QuantizationInfo(1.f, 0);
120
121 Tensor input = create_tensor<Tensor>(shape, dtype, 1, qinfo, layout);
122 Tensor output = create_tensor<Tensor>(shape, dtype, 1, qinfo, layout);
123
124 NEPooling3dLayer pool;
125 pool.configure(&input, &output, pool_info);
126
127 input.allocator()->allocate();
128 output.allocator()->allocate();
129
130 std::vector<int8_t> values = {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8};
131
132 ARM_COMPUTE_EXPECT(values.size() == shape.x(), framework::LogLevel::ERRORS);
133
134 library->fill_static_values(Accessor(input), values);
135
136 pool.run();
137 for (unsigned int i = 0; i < values.size(); ++i)
138 {
139 const int8_t ref = values[i];
140 const int8_t target = reinterpret_cast<int8_t *>(output.buffer())[i];
141 ARM_COMPUTE_EXPECT(ref == target, framework::LogLevel::ERRORS);
142 }
143}
144
145// *INDENT-OFF*
146// clang-format off

Callers

nothing calls this directly

Calls 14

Pooling3dLayerInfoClass · 0.85
Size3DClass · 0.85
Padding3DClass · 0.85
AccessorClass · 0.85
fill_static_valuesMethod · 0.80
TensorShapeClass · 0.50
QuantizationInfoClass · 0.50
configureMethod · 0.45
allocateMethod · 0.45
allocatorMethod · 0.45
sizeMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected