larray.Array.broadcast_with

Array.broadcast_with(target, check_compatible=False) Array[source]

Return an array that is (NumPy) broadcastable with target.

  • all common axes must be either of length 1 or the same length

  • extra axes in source can have any length and will be moved to the front

  • extra axes in target can have any length and the result will have axes of length 1 for those axes

This is different from reshape which ensures the result has exactly the shape of the target.

Parameters
targetArray or collection of Axis
check_compatiblebool, optional

Whether to check that common axes are compatible. Defaults to False.

Returns
Array