Transpose#

class myoverse.transforms.Transpose(dims, **kwargs)[source]#

Transpose/permute dimensions.

Parameters:

dims (tuple[int, ...] | tuple[str, ...]) – New dimension order (by index or name).

Examples

>>> x = torch.randn(64, 2048, names=('channel', 'time'))
>>> transpose = Transpose(('time', 'channel'))
>>> y = transpose(x)  # Shape: (2048, 64)

Methods

__init__(dims, **kwargs)

_apply(x)

Apply the transform.