HI,
thanks for the reply, i tried to run this but now the gradient are none type objects as shown by this error
     17     with torch.no_grad():
---> 18         whh-=lr*whh.grad
     19         wxt-=lr*wxt.grad
     20         why-=lr*why.grad

TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

here is the way i initialise whh,wxt,why
whh=torch.randn(10,10,requires_grad=True)
wxt=torch.randn(10,1,requires_grad=True)
why=torch.randn(1,10,requires_grad=True)