pub fn quantize<T: Float + ConstZero + ConstOne + Serialize, Q: Unsigned, S: Data<Elem = T>, D: Dimension>(
data: &ArrayBase<S, D>,
quantize: impl Fn(T) -> Q,
) -> Result<Vec<Q>, LinearQuantizeCodecError>Expand description
Linear-quantize the elements in the data array using the quantize
closure.
ยงErrors
Errors with
LinearQuantizeCodecError::NonFiniteDataif any data element is non- finite (infinite or NaN)LinearQuantizeCodecError::HeaderEncodeFailedif encoding the header failed