Skip to main content

try_load_tensor

Function try_load_tensor 

Source
pub fn try_load_tensor(
    content: &Content,
    reader: &mut (impl Read + Seek),
    name: &str,
    device: &Device,
    dtype: DType,
) -> Result<Option<Tensor>>
Expand description

Same as load_tensor, but returns Ok(None) instead of erroring when the tensor is absent.