I don’t know what effects such a reassignment does, because that’s not an idiomatic pytorch code, to put it mildly. “Variable” is obsolete, and that line shouldn’t be there at all. For first assignment - yes, it may train, but your parameter won’t be registered.