"research/autoencoder/VariationalAutoencoderRunner.py" did not exist on "70097a35665b5969bdee614850dac506db42c314"
transpose.py 222 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
import torch
from torch_sparse import coalesce


def transpose(index, value, m, n):
    row, col = index
    index = torch.stack([col, row], dim=0)

    index, value = coalesce(index, value, m, n)

    return index, value