Skip to main content

per_channel_params

Function per_channel_params 

Source
pub fn per_channel_params(
    x: &Array2<f64>,
    axis: usize,
    dtype: IntDtype,
    scheme: QuantScheme,
) -> Result<Vec<QuantParams>, GpuOptimError>
Expand description

Calibrate one QuantParams per channel along axis of a 2-D tensor.

axis == 0 treats each row as a channel, axis == 1 each column. Each channel receives its own scale (and, for affine, its own zero-point) computed from that channel’s slice only.

§Errors

Returns GpuOptimError::InvalidState for an invalid axis and propagates any per-channel calibration error (e.g. a degenerate all-zero channel).