Function load_onnx_weights
Source pub fn load_onnx_weights<B: Backend>(
path: impl AsRef<Path>,
device: &B::Device,
) -> Result<HashMap<String, Tensor<B>>>
Expand description
Load tensor weights from an ONNX model file.
Returns a map of tensor name → Tensor for all initializers found.
§Example
ⓘlet weights = load_onnx_weights::<CpuBackend>("model.onnx", &CpuDevice)?;
for (name, tensor) in &weights {
println!("{}: {:?}", name, tensor.dims());
}