Why does an attribute has a method?
I use pytorch define a Variable x, compute and get its gradient x.grad, meaning grad is an attribute of instance x. But, I can use x.grad.data.zero_() to set x.grad to zero meaning that data.zero_() is method of x.grad. Why does an attribute has a method? Thanks a lot.

It will be just an object attribute, for example we can have an attribute of type String. And we all now String have his own methods including the method that prints out the value of itself
