spyrit.misc.walsh_hadamard.walsh2_S_unfold_torchļ
- spyrit.misc.walsh_hadamard.walsh2_S_unfold_torch(X)[source]ļ
Unfold a signal from a ā2dā s-transformed representation
Note: Return a view of X
- Args:
X(torch.tensor): input image with shape (*, n,n).- Returns:
output signal with shape (*, n*n-1)
- Example 1:
>>> import spyrit.misc.walsh_hadamard as wh >>> import torch >>> X = torch.tensor([[1, 3, 0, 8],[7, 5, 1, 2]]) >>> x = wh.walsh2_S_unfold_torch(X) >>> print(X) >>> print(x)
- Example 2:
>>> import spyrit.misc.walsh_hadamard as wh >>> import torch >>> X = torch.randint(10,(3,4,4)) >>> x = wh.walsh2_S_unfold_torch(X) >>> print(X) >>> print(x)