Move tensor failed?

all right,i understand it now and fix it,but i got a error like this post, RuntimeError: OrderedDict mutated during iteration (while using hook),

and no answer under this post, i find this line code in pytorch ‘nn/module.py’ like this
,so is there a bug or my way using hook are not right?