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

Function zeros

tests/validation/Helpers.cpp:280–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278
279template <typename T>
280void zeros(SimpleTensor<T> &in, const Coordinates &anchor, const TensorShape &shape)
281{
282 ARM_COMPUTE_ERROR_ON(anchor.num_dimensions() != shape.num_dimensions());
283 ARM_COMPUTE_ERROR_ON(in.shape().num_dimensions() > 2);
284 ARM_COMPUTE_ERROR_ON(shape.num_dimensions() > 2);
285
286 // Check if with the dimensions greater than 2 we could have out-of-bound reads
287 for (size_t d = 0; d < Coordinates::num_max_dimensions; ++d)
288 {
289 if (anchor[d] < 0 || ((anchor[d] + shape[d]) > in.shape()[d]))
290 {
291 ARM_COMPUTE_ERROR("anchor[d] < 0 || (anchor[d] + shape[d]) > in.shape()[d]");
292 }
293 }
294
295 // Get input pointer
296 auto in_ptr = static_cast<T *>(in(anchor[0] + anchor[1] * in.shape()[0]));
297
298 const unsigned int n = in.shape()[0];
299
300 for (unsigned int y = 0; y < shape[1]; ++y)
301 {
302 std::fill(in_ptr, in_ptr + shape[0], 0);
303 in_ptr += n;
304 }
305}
306
307std::pair<int, int> get_quantized_bounds(const QuantizationInfo &quant_info, float min, float max)
308{

Callers

nothing calls this directly

Calls 3

fillFunction · 0.85
num_dimensionsMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected