INNER CODE UNIT · Rust
usize_to_i64
rustformers/llm · crates/ggml/src/lib.rs:399
fn usize_to_i64(val: usize) -> i64 {
i64::try_from(val).unwrap()
}
fn i32_to_usize(val: i32) -> usize {
usize::try_from(val).unwrap()
}
fn i64_to_usize(val: i64) -> usize {
usize::try_from(val).unwrap()
}
/// Contains the result of a quantization operation.
pub struct QuantizationResult {
/// The quantized output.
pub output: Vec<u8>,
/// The quantization history.
pub history: Vec<i64>,