dpnp.tensor.broadcast_to

dpnp.tensor.broadcast_to(X, /, shape)[source]

Broadcast an array to a new shape; returns the broadcasted dpnp.tensor.usm_ndarray as a view.

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

  • shape (tuple of ints) -- Array shape. The shape must be compatible with x according to broadcasting rules.

Returns:

out -- An array with the specified shape. The output array is a view of the input array, and hence has the same data type, USM allocation type and device attributes.

Return type:

usm_ndarray