email@example.com提交于 about 4 hours前 ：Delete all trivial uses of make_variable. (#29213)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29213
A trivial use of make_variable is one where requires_grad=False. This
transformation is not technically semantics preserving, as make_variable
will create a shallow copy of the tensor in question; however, I
am guessing that we have the invariant that we don't actually make
use of this shallow copy in a nontrivial way.
There were some cases where the surrounding code expected a Variable proper
to be returned; I retained those sites.
Signed-off-by: Edward Z. Yang <firstname.lastname@example.org>
Test Plan: Imported from OSS
Differential Revision: D18353503
Pulled By: ezyang