@albanD thanks so much. I also thought that it may be because of the floating points since gradient gets too large in this particular example. Since I wanted to compare numeric values I used .data. I will also consider your other advices, so the conclusion is they are same right?