Default to wrapping optimizer.Apply in learner variable_scope.
Default to wrapping optimizer.Apply in learner variable_scope.

optimizer.Apply can create variables. The variables created by different
optimizers can conflict with the same name in eager mode (there is no variable
name auto-uniquification in eager mode). Thus manually wrapping them in a
variable scope is necessary.

Also delete an unused function.

PiperOrigin-RevId: 415344496

tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo