Solved by eqy in post #2 
              
              
                I believe that this is because numpy will do operations in float64 by default while in torch they are in float32. For example: 
import torch
import numpy as np

mu1 = torch.Tensor([0.4651]).to(torch.double)
mu2 = torch.Tensor([0.4652]).to(torch.double)
sigma1 = torch.Tensor([0.7910]).to(torch.doubl…