@albanD
I just upgrade pytorch to 0.3.1. it gives the same result:  no gradients for ht.
torch.__version__

‘0.3.1’
ht.grad.data


AttributeError                            Traceback (most recent call last)
 in ()
----> 1 ht.grad.data
AttributeError: ‘NoneType’ object has no attribute ‘data’