identity

selfeeg.augmentation.functional.identity(x: ArrayLike) ArrayLike[source]

returns the same array or tensor it was given.

It can be used during augmentation composition to randomly avoid some augmentations.

Parameters:

x (ArrayLike) – the input Tensor or Array.

Returns:

x (ArrayLike) – the input Tensor or Array.

Example

>>> import torch
>>> import selfeeg.augmentation as aug
>>> x = torch.zeros(16,32,1024) + torch.sin(torch.linspace(0, 8*torch.pi,1024))
>>> xaug = aug.identity(x)
>>> print(torch.equal(x,xaug)) # should return True