Skip to main content

load_weight

Function load_weight 

Source
pub fn load_weight(
    content: &Content,
    reader: &mut (impl Read + Seek),
    name: &str,
    expected_d_out: usize,
    device: &Device,
) -> Result<Tensor>
Expand description

Load an F32 weight PyTorch stores as (d_out, d_in). Candle reverses the GGUF shape back to (d_out, d_in); the dim(0) check guards against a stray transposed store (the Q8_0 transpose trick some converters apply) by flipping the tensor back.