dask 2021.10.0

ParametersReturns
broadcast_arrays(*args, **kwargs)

This docstring was copied from numpy.broadcast_arrays.

Some inconsistencies with the Dask version may exist.

Parameters

`*args` : array_likes

The arrays to broadcast.

subok : bool, optional (Not supported in Dask)

If True, then sub-classes will be passed-through, otherwise the returned arrays will be forced to be a base-class array (default).

Returns

broadcasted : list of arrays

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first. While you can set the writable flag True, writing to a single output value may end up changing more than one location in the output array.

deprecated

The output is currently marked so that if written to, a deprecation warning will be emitted. A future version will set the writable flag False so writing to it will raise an error.

Broadcast any number of arrays against each other.

See Also

broadcast
broadcast_shapes
broadcast_to

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.array([[1,2,3]])  # doctest: +SKIP
... y = np.array([[4],[5]]) # doctest: +SKIP
... np.broadcast_arrays(x, y) # doctest: +SKIP [array([[1, 2, 3], [1, 2, 3]]), array([[4, 4, 4], [5, 5, 5]])]

Here is a useful idiom for getting contiguous copies instead of non-contiguous views.

This example is valid syntax, but we were not able to check execution
>>> [np.array(a) for a in np.broadcast_arrays(x, y)]  # doctest: +SKIP
[array([[1, 2, 3],
       [1, 2, 3]]), array([[4, 4, 4],
       [5, 5, 5]])]
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/core.py#4621
type: <class 'function'>
Commit: