[Solved] 'y = x' or 'y = x.detach()' in inference mode?

After update to pytorch 0.4.0, I am confused about the keyward detach
What is the difference between

y = x
y = x.detach()
y = x.clone()

Especially when I do not need backward computation.

I think @richard provided a nice explanationhere:

Does this answer your question?

1 Like

Yeah that answers my question. Also thank you for your link.