{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "5f3fed9f21a57390cc7f00f77a37db8f5f110cb8",
    "tool": "doxyref",
    "version": "1.17.0"
  },
  "language": "c",
  "modules": [
    {
      "description": "",
      "name": "Reshape Functions",
      "path": "heliaCORE.Reshape",
      "submodules": [],
      "summary": "",
      "symbols": [
        {
          "description": "Scratch size in bytes for `arm_resize_nearest_neighbor_f32()` / `arm_resize_nearest_neighbor_f16()`.\n\nThe 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).",
          "examples": [],
          "id": "arm_resize_nearest_neighbor_f32_get_buffer_size",
          "kind": "function",
          "language": "c",
          "members": [],
          "name": "arm_resize_nearest_neighbor_f32_get_buffer_size",
          "params": [
            {
              "description": "Output tensor dimensions (only h and w are read).",
              "direction": "in",
              "name": "output_dims",
              "type": "const cmsis_nn_dims *"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "Required ctx->size in bytes, or -1."
            }
          ],
          "signature": "int32_t arm_resize_nearest_neighbor_f32_get_buffer_size(const cmsis_nn_dims *output_dims)",
          "source": {
            "line": 1425,
            "path": "Include/arm_nnfunctions_flt.h",
            "url": "https://github.com/AmbiqAI/ns-cmsis-nn/blob/5f3fed9f21a57390cc7f00f77a37db8f5f110cb8/Include/arm_nnfunctions_flt.h#L1425"
          },
          "summary": "Scratch size in bytes for armresizenearestneighborf32() / armresizenearestneighborf16()."
        },
        {
          "description": "Nearest-neighbor resize of a float32 NHWC tensor.\n\nPure data movement: every output element is a bit copy of one input element, so NaN (sign and payload), +/-Inf, -0.0 and subnormals are preserved bit-for-bit on the scalar and MVE legs alike (the MVE copy is a tail-predicated vldr/vstr pair, not an FP operation, so FPSCR flush-to-zero and default-NaN do not apply). No arithmetic is performed on the data; the only float math is the float32 index scale below.\n\nIndex semantics are TFLite's RESIZE_NEAREST_NEIGHBOR reference, evaluated in float32 per axis: scale = (align_corners && out > 1) ? (in - 1) / (out - 1) : in / out idx = align_corners ? roundf((o + offset) * scale) : floorf((o + offset) * scale) idx = min(idx, in - 1); if (half_pixel_centers) idx = max(idx, 0) with offset = half_pixel_centers ? 0.5f : 0.0f; roundf rounds ties away from zero, matching TfLiteRound. All four align_corners/half_pixel_centers combinations were verified bit-for-bit against TFLite 2.20 over a shape sweep (1..16 square, 80 random NHWC shapes up to 40x40, 224->7 and 7->224), including the out == 1 align_corners case, which maps to input index 0.",
          "examples": [],
          "id": "arm_resize_nearest_neighbor_f32",
          "kind": "function",
          "language": "c",
          "members": [],
          "name": "arm_resize_nearest_neighbor_f32",
          "params": [
            {
              "description": "Scratch context. ctx->buf must be non-NULL and 4-byte aligned, and ctx->size at least arm_resize_nearest_neighbor_f32_get_buffer_size(output_shape); the kernel writes the x/y index maps here and does not read them after returning.",
              "direction": "in",
              "name": "ctx",
              "type": "const cmsis_nn_context *"
            },
            {
              "description": "align_corners / half_pixel_centers.",
              "direction": "in",
              "name": "resize_params",
              "type": "const cmsis_nn_resize_params *"
            },
            {
              "description": "Input tensor dimensions in NHWC format; every dimension must be >= 1.",
              "direction": "in",
              "name": "input_shape",
              "type": "const cmsis_nn_dims *"
            },
            {
              "description": "Input tensor data. Must not overlap `output_data`.",
              "direction": "in",
              "name": "input_data",
              "type": "const float32_t *"
            },
            {
              "description": "Dimensions of the output-size tensor; must hold exactly 2 elements.",
              "direction": "in",
              "name": "output_size_shape",
              "type": "const cmsis_nn_dims *"
            },
            {
              "description": "Output size as [output_height, output_width], both >= 1.",
              "direction": "in",
              "name": "output_size_data",
              "type": "const int32_t *"
            },
            {
              "description": "Output tensor dimensions in NHWC format; n and c must equal the input's and h/w must equal `output_size_data`.",
              "direction": "in",
              "name": "output_shape",
              "type": "const cmsis_nn_dims *"
            },
            {
              "description": "Output tensor data.",
              "direction": "out",
              "name": "output_data",
              "type": "float32_t *"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "ARM_CMSIS_NN_SUCCESS, or ARM_CMSIS_NN_ARG_ERROR when any constraint above fails (including a NULL pointer argument); nothing is written on ARG_ERROR."
            }
          ],
          "signature": "arm_cmsis_nn_status arm_resize_nearest_neighbor_f32(\n    const cmsis_nn_context *ctx,\n    const cmsis_nn_resize_params *resize_params,\n    const cmsis_nn_dims *input_shape,\n    const float32_t *input_data,\n    const cmsis_nn_dims *output_size_shape,\n    const int32_t *output_size_data,\n    const cmsis_nn_dims *output_shape,\n    float32_t *output_data\n)",
          "source": {
            "line": 1458,
            "path": "Include/arm_nnfunctions_flt.h",
            "url": "https://github.com/AmbiqAI/ns-cmsis-nn/blob/5f3fed9f21a57390cc7f00f77a37db8f5f110cb8/Include/arm_nnfunctions_flt.h#L1458"
          },
          "summary": "Nearest-neighbor resize of a float32 NHWC tensor."
        },
        {
          "description": "Scratch size in bytes for `arm_resize_nearest_neighbor_f32()` / `arm_resize_nearest_neighbor_f16()`.\n\nThe 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).",
          "examples": [],
          "id": "arm_resize_nearest_neighbor_f16_get_buffer_size",
          "kind": "function",
          "language": "c",
          "members": [],
          "name": "arm_resize_nearest_neighbor_f16_get_buffer_size",
          "params": [
            {
              "description": "Output tensor dimensions (only h and w are read).",
              "direction": "in",
              "name": "output_dims",
              "type": "const cmsis_nn_dims *"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "Required ctx->size in bytes, or -1."
            }
          ],
          "signature": "int32_t arm_resize_nearest_neighbor_f16_get_buffer_size(const cmsis_nn_dims *output_dims)",
          "source": {
            "line": 3294,
            "path": "Include/arm_nnfunctions_flt.h",
            "url": "https://github.com/AmbiqAI/ns-cmsis-nn/blob/5f3fed9f21a57390cc7f00f77a37db8f5f110cb8/Include/arm_nnfunctions_flt.h#L3294"
          },
          "summary": "Scratch size in bytes for armresizenearestneighborf32() / armresizenearestneighborf16()."
        },
        {
          "description": "Nearest-neighbor resize of a float32 NHWC tensor.\n\nPure data movement: every output element is a bit copy of one input element, so NaN (sign and payload), +/-Inf, -0.0 and subnormals are preserved bit-for-bit on the scalar and MVE legs alike (the MVE copy is a tail-predicated vldr/vstr pair, not an FP operation, so FPSCR flush-to-zero and default-NaN do not apply). No arithmetic is performed on the data; the only float math is the float32 index scale below.\n\nIndex semantics are TFLite's RESIZE_NEAREST_NEIGHBOR reference, evaluated in float32 per axis: scale = (align_corners && out > 1) ? (in - 1) / (out - 1) : in / out idx = align_corners ? roundf((o + offset) * scale) : floorf((o + offset) * scale) idx = min(idx, in - 1); if (half_pixel_centers) idx = max(idx, 0) with offset = half_pixel_centers ? 0.5f : 0.0f; roundf rounds ties away from zero, matching TfLiteRound. All four align_corners/half_pixel_centers combinations were verified bit-for-bit against TFLite 2.20 over a shape sweep (1..16 square, 80 random NHWC shapes up to 40x40, 224->7 and 7->224), including the out == 1 align_corners case, which maps to input index 0.\n\n:::note\nfloat16 twin: each element is copied as a 16-bit lane with no widening or conversion, so half-precision NaN payloads and subnormals are preserved exactly and the data is never evaluated in float32. Scratch is sized by `arm_resize_nearest_neighbor_f16_get_buffer_size()` (same query as f32).\n\n:::",
          "examples": [],
          "id": "arm_resize_nearest_neighbor_f16",
          "kind": "function",
          "language": "c",
          "members": [],
          "name": "arm_resize_nearest_neighbor_f16",
          "params": [
            {
              "description": "Scratch context. ctx->buf must be non-NULL and 4-byte aligned, and ctx->size at least arm_resize_nearest_neighbor_f32_get_buffer_size(output_shape); the kernel writes the x/y index maps here and does not read them after returning.",
              "direction": "in",
              "name": "ctx",
              "type": "const cmsis_nn_context *"
            },
            {
              "description": "align_corners / half_pixel_centers.",
              "direction": "in",
              "name": "resize_params",
              "type": "const cmsis_nn_resize_params *"
            },
            {
              "description": "Input tensor dimensions in NHWC format; every dimension must be >= 1.",
              "direction": "in",
              "name": "input_shape",
              "type": "const cmsis_nn_dims *"
            },
            {
              "description": "Input tensor data. Must not overlap `output_data`.",
              "direction": "in",
              "name": "input_data",
              "type": "const float16_t *"
            },
            {
              "description": "Dimensions of the output-size tensor; must hold exactly 2 elements.",
              "direction": "in",
              "name": "output_size_shape",
              "type": "const cmsis_nn_dims *"
            },
            {
              "description": "Output size as [output_height, output_width], both >= 1.",
              "direction": "in",
              "name": "output_size_data",
              "type": "const int32_t *"
            },
            {
              "description": "Output tensor dimensions in NHWC format; n and c must equal the input's and h/w must equal `output_size_data`.",
              "direction": "in",
              "name": "output_shape",
              "type": "const cmsis_nn_dims *"
            },
            {
              "description": "Output tensor data.",
              "direction": "out",
              "name": "output_data",
              "type": "float16_t *"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "ARM_CMSIS_NN_SUCCESS, or ARM_CMSIS_NN_ARG_ERROR when any constraint above fails (including a NULL pointer argument); nothing is written on ARG_ERROR."
            }
          ],
          "signature": "arm_cmsis_nn_status arm_resize_nearest_neighbor_f16(\n    const cmsis_nn_context *ctx,\n    const cmsis_nn_resize_params *resize_params,\n    const cmsis_nn_dims *input_shape,\n    const float16_t *input_data,\n    const cmsis_nn_dims *output_size_shape,\n    const int32_t *output_size_data,\n    const cmsis_nn_dims *output_shape,\n    float16_t *output_data\n)",
          "source": {
            "line": 3302,
            "path": "Include/arm_nnfunctions_flt.h",
            "url": "https://github.com/AmbiqAI/ns-cmsis-nn/blob/5f3fed9f21a57390cc7f00f77a37db8f5f110cb8/Include/arm_nnfunctions_flt.h#L3302"
          },
          "summary": "Nearest-neighbor resize of a float32 NHWC tensor."
        }
      ]
    }
  ],
  "name": "heliaCORE"
}
