dpnp.broadcast_to¶
- dpnp.broadcast_to(array, /, shape, subok=False)[source]¶
Broadcast an array to a new shape.
For full documentation refer to
numpy.broadcast_to.- Parameters:
- array{dpnp.ndarray, usm_ndarray}
The array to broadcast.
- shape{int, tuple of ints}
The shape of the desired array. A single integer
iis interpreted as(i,).
- Returns:
- outdpnp.ndarray
An array having a specified shape. Must have the same data type as array.
Limitations
Parameter subok is supported with default value. Otherwise
NotImplementedErrorexception will be raised.See also
dpnp.broadcastProduce an object that mimics broadcasting.
dpnp.broadcast_arraysBroadcast any number of arrays against each other.
dpnp.broadcast_shapesBroadcast the input shapes into a single shape.
Examples
>>> import dpnp as np >>> x = np.array([1, 2, 3]) >>> np.broadcast_to(x, (3, 3)) array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])