Solved by InnovArul in post #2 
              
              
                This behavior is due to numerical precision of float tensors. You can use .allclose() to check if float tensors are equal upto epsilon. 
Additionally, you can print the numpy array to see the exact values stored in the tensor. 
import torch
import numpy as np
np.set_printoptions(precision=10)

def a…