[BE] Use OptimizerInfo step_requires_closure, only_supports_sparse_grads (#119230)
So I had planned ahead of time to use these but forgot to actually use them when migrating tests.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/119230
Approved by: https://github.com/albanD