| 278 | |
| 279 | template <typename T> |
| 280 | void 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 | |
| 307 | std::pair<int, int> get_quantized_bounds(const QuantizationInfo &quant_info, float min, float max) |
| 308 | { |
nothing calls this directly
no test coverage detected