Skip to main content

load_array

Function load_array 

Source
pub fn load_array<F: ArrayElement>(
    path: &Path,
) -> Result<Array<F, IxDyn>, SerializationError>
Expand description

Load an n-dimensional array from a .scirs2 file.

The element type F is checked against the dtype stored in the file; a SerializationError::TypeMismatch is returned if they differ.

ยงExample

use scirs2_core::serialization::load_array;

let arr = load_array::<f64>(std::path::Path::new("/tmp/eye4.scirs2")).expect("should succeed");
println!("shape: {:?}", arr.shape());