fields.buffers.base.BufferBase.broadcast_to#
- BufferBase.broadcast_to(shape: Any, *args, **kwargs) BufferBase [source]#
Broadcast an array to a new shape.
- Parameters:
shape (
tuple
orint
) – The shape of the desired output array. A single integeri
is interpreted as(i,)
.- Returns:
broadcast – A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.
- Return type:
- Raises:
ValueError – If the array is not compatible with the new shape according to NumPy’s broadcasting rules.