spyrit.misc.walsh_hadamard.sequency_perm_torch

spyrit.misc.walsh_hadamard.sequency_perm_torch(X, ind=None)[source]

Permute the last dimension of a tensor to get sequency order

Args:

X (torch.tensor): -by-n input matrix

ind : index list of length n

Returns:

torch.tensor: -by-n input matrix

Example :
>>> import spyrit.misc.walsh_hadamard as wh
>>> x = torch.tensor([1, 3, 0, -1, 7, 5, 1, -2])
>>> x = x[None, None, :]
>>> x = wh.sequency_perm_torch(x)
>>> print(x)