dpnp.tensor.reshape

dpnp.tensor.reshape(X, /, shape, *, order='C', copy=None)[source]

Reshapes array x into new shape.

Parameters:
  • x (usm_ndarray) -- Input array.

  • shape (tuple of ints) -- The desired shape of the resulting array.

  • order ({"C", "F"}, optional) --

    Memory layout of the resulting array if a copy is found to be necessary. Supported choices are "C" for C-contiguous, or row-major layout; and "F" for F-contiguous, or column-major layout.

    Default: "C".

  • copy ({None, bool}, optional) --

    Whether or not to copy the input array. If True, always copies. If False, never copies and raises a ValueError if a copy is required. If None, copies only when necessary.

    Default: None.

Returns:

out -- Reshaped array is a view, if possible, and a copy otherwise with memory layout as indicated by order keyword.

Return type:

usm_ndarray