COO.broadcast_to

COO.broadcast_to(shape)[source]

Performs the equivalent of numpy.broadcast_to for COO. Note that this function returns a new array instead of a view.

Parameters:

shape (tuple[int]) – The shape to broadcast the data to.

Returns:

The broadcasted sparse array.

Return type:

COO

Raises:

ValueError – If the operand cannot be broadcast to the given shape.

See also

numpy.broadcast_to

NumPy equivalent function