Function deepviewrt_sys::nn_tensor_quantize_buffer
source · pub unsafe extern "C" fn nn_tensor_quantize_buffer(
dest: *mut NNTensor,
buffer_length: usize,
buffer: *const f32,
axis: c_int
) -> NNErrorExpand description
Quantizes the source buffer into the destination tensor.
The source tensor should be float and the destination integer. If the destination tensor does not have quantization parameters they will be calculated from the source buffer and stored into the destination tensor.
When calculating the quantization parameters if axis is a valid axis* then per-channel quantization will be performed along the axis, otherwise per-tensor quantization will be performed. If the destination tensor has quantization parameters axis is ignored.
Valid Axis: (axis > 0 && axis < n_dims)
@public @memberof NNTensor @since 2.4