Imaginary Component Error when calculating FID

So this bit of code has been working fine for me the last time I ran it… but has a recent update to torch caused the FID score to blow up ? I am a bit suspicious of this warning:
UserWarning: The torch.cuda.*DtypeTensor constructors are no longer recommended. It's best to use methods such as torch.tensor(data, dtype=*, device='cuda') to create tensors.

So whenever I am running the training process, I get:

<ipython-input-8-6bc3f7d49a34> in calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps)
     32         if not np.allclose(np.diagonal(covmean).imag, 0, atol=1e-3):
     33             m = np.max(np.abs(covmean.imag))
---> 34             raise ValueError('Imaginary component {}'.format(m))
     35         covmean = covmean.real

ValueError: Imaginary component 1.172166351981351e+117

This is just an example provided by my class (which I haven’t changed) but I am not sure how to go about debugging this especially since I have limited GPU usage on colab. Any ideas? Thanks!

I have tried changing the code as per the user warning from:
z = Variable(Tensor(np.random.normal(0, 1, (imgs.shape[0], opt.latent_dim))))
z = Variable(torch.tensor(data=np.random.normal(0, 1, (imgs.shape[0], opt.latent_dim)),dtype=torch.float, device='cuda')) if cuda else torch.FloatTensor

Still seems to blow up the FID value and throws the imaginary value error