Reshape#

class myoverse.transforms.Reshape(shape, names=None, **kwargs)[source]#

Reshape tensor with new dimension names.

Parameters:
  • shape (tuple[int, ...]) – New shape (-1 allowed for one dimension).

  • names (tuple[str, ...] | None) – New dimension names.

Examples

>>> x = torch.randn(64, 2048, names=('channel', 'time'))
>>> reshape = Reshape((8, 8, 2048), names=('row', 'col', 'time'))
>>> y = reshape(x)  # Shape: (8, 8, 2048)

Methods

__init__(shape[, names])

_apply(x)

Apply the transform.