Function arm_resize_nearest_neighbor_f32_get_buffer_size

Function Documentation

int32_t arm_resize_nearest_neighbor_f32_get_buffer_size(const cmsis_nn_dims *output_dims)

Scratch size in bytes for arm_resize_nearest_neighbor_f32() / arm_resize_nearest_neighbor_f16().

The kernels precompute one int32_t input index per output row and per output column, so the requirement is (output_dims->h + output_dims->w) * sizeof(int32_t). Returns -1 (never 0) when output_dims is NULL, when h or w is less than 1, or when the size does not fit in int32_t; a negative result must not be used to size a buffer, and the kernels reject a { NULL, 0 } context outright (the -1 family of the integer sizers, not the 0-returning family most float sizers use; see the sentinel note on arm_nn_size_mul).

Parameters:
  • output_dims[in] Output tensor dimensions (only h and w are read).

Returns:

Required ctx->size in bytes, or -1.