dpnp.broadcast

class dpnp.broadcast(*args)[source]

Produce an object that mimics broadcasting.

For full documentation refer to numpy.broadcast.

Parameters:

*args (array_like) -- Input parameters.

Returns:

broadcast -- Broadcast the input parameters against one another, and return an object that encapsulates the result. Amongst others, it has shape and nd properties, and may be used as an iterator.

Return type:

broadcast object

See also

dpnp.broadcast_arrays

Broadcast any number of arrays against each other.

dpnp.broadcast_to

Broadcast an array to a new shape.

dpnp.broadcast_shapes

Broadcast the input shapes into a single shape.

Examples

>>> import dpnp as np
>>> x = np.array([[1], [2], [3]])
>>> y = np.array([4, 5, 6])
>>> b = np.broadcast(x, y)
>>> b.shape
(3, 3)
>>> b.nd
2
>>> b.size
9

Notes

Iterator functionality is not supported.