Hello @vvanirudh,
does this serve your needs (using https://en.wikipedia.org/wiki/Multivariate_normal_distribution#Drawing_values_from_the_distribution 126)?
import torch
import numpy
# take target covariance
cov = numpy.array(((1,0.5),(0.5,1)), dtype=numpy.float32)
# compute cholesky factor in numpy
l = torch.from_numpy(numpy.linalg.cholesky(cov))
# sample standard normal random and multiply
rnd = torch.mm(l,torch.randn(2,10000))
# check covariance in numpy
print (numpy.cov(rnd.numpy()))
Best regards
Thomas