Solved by tom in post #10 
              
              
                I write the dimensions in the comments. Given: 
z = torch.randn(7,5)   # i, d use torch.stack([list of z_i], 0) if you don't know how  to get this otherwise.
mu = torch.randn(6,5)  # j, d
nu = 1.2

you do 
# I don't use norm. Norm is more memory-efficient, but possibly less numerically stable in bac…