Index#

class myoverse.transforms.Index(indices, dim='time', **kwargs)[source]#

Index/slice along a dimension.

Parameters:
  • indices (int | slice | list[int]) – Indices to select.

  • dim (str) – Dimension to index.

Examples

>>> x = torch.randn(64, 2048, names=('channel', 'time'))
>>> # Select first 10 channels
>>> index = Index(slice(0, 10), dim='channel')
>>> y = index(x)  # Shape: (10, 2048)

Methods

__init__(indices[, dim])

_apply(x)

Apply the transform.