thanks

I thought it would be better to give executable code, will give snippet next time.
my problem seems to have gotten solved after doing x.grad.data.zero_(), it seems that the gradients were accruing up into the variable of interest. Will do some more tests to verify.
Thanks for the info on clone, it was causing short circuit of gradients. a question is why allow the clone to affect the original gradients? if someone wanted x to be connected to it, they would have used x, and not a clone of it. I was thinking it was just a numeric copy of x, but otherwise disconnected from it, like in Theano.