Skip to main content

frombuffer

Function frombuffer 

Source
pub fn frombuffer<T, D>(dim: D, buf: &[u8]) -> Result<Array<T, D>, FerrayError>
where T: Element, D: Dimension,
Expand description

Create an array from a byte buffer, interpreting bytes as elements of type T.

Analogous to numpy.frombuffer().

§Errors

Returns FerrayError::InvalidValue if the buffer length is not a multiple of size_of::<T>(), or if the resulting length does not match the shape.