fields.buffers.base.BufferBase.reshape#

BufferBase.reshape(shape, *args, **kwargs) BufferBase[source]#

Return a reshaped copy of this buffer.

This reshapes the buffer into a new shape and returns a new buffer instance. The reshaping is done using the NumPy-compatible view returned by as_repr().

Parameters:
  • shape (tuple of int) – Target shape for the new buffer.

  • *args – Additional positional arguments forwarded to from_array.

  • **kwargs – Additional keyword arguments forwarded to from_array.

Returns:

A new buffer with reshaped data.

Return type:

BufferBase