Skip to main content

reshape

Function reshape 

Source
pub fn reshape<T: Element, D: Dimension>(
    a: &Array<T, D>,
    new_shape: &[usize],
) -> FerrayResult<Array<T, IxDyn>>
Expand description

Reshape an array to a new shape (returns a new owned array).

The total number of elements must remain the same.

Analogous to numpy.reshape().

ยงErrors

Returns FerrayError::ShapeMismatch if the new shape has a different total number of elements.