pub unsafe extern "C" fn nn_model_layer_scales(
model: *const NNModel,
index: usize,
n_scales: *mut usize,
) -> *const f32Expand description
Returns the array of quantization scales, and optionally the number of scales in the array. The length will either be 0, 1, or equal to the number of channels in an NHWC/NCHW tensor.
The channel axis can be queried using @ref nn_model_layer_axis().
If no quantization parameters are available then n_scales will be 0. If the tensor is quantized using full tensor quantization n_scales will be 1. If the tensor is quantized using per-channel quantization n_scales will be C which will equal the channel dimension of the tensor. For an NHWC tensor it would equal shape[3].
@public @memberof NNModel @since 2.4