Actually, below code still gets NaN, even when there is no division by anything:
vec_tensor = torch.from_numpy(vec)

# check if input is nan
if np.isnan(np.sum(vec_tensor.cpu().numpy())):
    print("some values from input are nan")    

x = vec_tensor[:,0:ZONE_SIZE*2]
x = x.view(-1, ZONE_SIZE * 2)

#x_mean = torch.mean(x, dim=1).view(-1,1)
#x_std = torch.std(x, dim=1).view(-1,1)
#print x_std

#x = (x -x_mean) / x_std

o = net.linear1(x)
print (o)