dpctl.tensor.reshape

dpctl.tensor.reshape(x, shape, order='C')[source]

Reshapes array x into new shape.

Parameters:
  • x (usm_ndarray) – input array

  • shape (Tuple[int]) – 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.

Returns:

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

Return type:

usm_ndarray