Skip to main content

copyto

Function copyto 

Source
pub fn copyto<T, D1, D2>(
    dst: &mut Array<T, D1>,
    src: &Array<T, D2>,
) -> FerrayResult<()>
where T: Element, D1: Dimension, D2: Dimension,
Expand description

Copy values from src into dst, broadcasting src to dst.shape().

Equivalent to np.copyto(dst, src) without the casting= or where= parameters. src may have any dimension type — it only needs to be broadcast-compatible with dst.shape(). The destination shape is fixed, so src can never grow the destination.

§Errors

Returns FerrayError::ShapeMismatch if src.shape() cannot be broadcast into dst.shape(). On error dst is left untouched.