in src/nv_wavenet_generator.py [0:0]
def column_major(x):
"""
PyTorch Tensors are row major, so this just returns a contiguous transpose
"""
assert (x.is_contiguous)
if len(x.size()) == 1:
return x
if len(x.size()) == 3:
assert (x.size(2) == 1)
x = torch.squeeze(x)
if len(x.size()) == 2:
return torch.t(x).contiguous()
if len(x.size()) == 4:
return x.permute(3, 2, 1, 0).contiguous()