Skip to main content

frombuffer

Function frombuffer 

Source
pub fn frombuffer<T: Element, D: Dimension>(
    dim: D,
    buf: &[u8],
) -> FerrayResult<Array<T, D>>
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.