No, you don’t need to reshape x. Since the graph was memorized in the previous gradient calculation, you should not change x if you wanna calculate high order gradient.
Hope it makes sense to you.
Michael Klachko noreply@discuss.pytorch.org 于2019年1月13日周日 上午6:45写道：