Suppose I have a pytorch tensor x of shape [N, N_g, 2]. It can be viewed as N * N_g 2d vectors. Specifically, x[i, j, :]
x
[N, N_g, 2]
N * N_g
x[i, j, :]