X = Variable(torch.from_numpy(xtr))
mu = Variable(torch.randn(10, 5), requires_grad=True)
print(X[0,:]-mu[:,0])
tensor([ -2.6652e+00,   2.0585e+00,  -4.6961e-01,   1.7443e+00, -4.7861e+180,
-6.3082e+199, -1.6779e+243, -9.3102e+242,   1.2467e+00,   2.9316e-01],
dtype=torch.float64, grad_fn=)




print(X[0,:])
tensor([-2.4682,  0.9872, -0.4661,  1.7443,  0.5375, -0.5948,  2.2457, -0.2980,
1.2467,  0.2932], dtype=torch.float64)




print(mu[:,0])
tensor([ 0.1971,  1.0803, -0.8145,  0.9733, -1.4811, -1.0713,  0.3086,  0.6137,
-0.6779,  0.3576], grad_fn=)




print(X[0,:].data.numpy()-mu[:,0].data.numpy())
[-2.66522103 -0.09317447  0.34836983  0.77099426  2.01856725  0.47648397
1.93714274 -0.91173426  1.92456246 -0.06439294]