pytorch/torch/optim
Jane Xu 75cb99e549 [optim] Widen the cases for defaulting to foreach (#95820)
Big OOP correction continued. Also added a test this time to verify the defaulting was as expected.

The key here is realizing that the grouping for foreach already assumes that the non-param tensorlists follow suit in dtype and device, so it is too narrow to check that _all_ tensors were on CUDA. The main leeway this allowed was state_steps, which are sometimes cpu tensors. Since foreach _can_ handle cpu tensors, this should not introduce breakage.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/95820
Approved by: https://github.com/albanD
2023-03-02 04:15:33 +00:00
..
_multi_tensor [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
__init__.py Update __init__.py (#91196) 2022-12-20 23:38:25 +00:00
__init__.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
_functional.py [optim] fix: empty grad support for SparseAdam (#86459) 2022-10-07 19:24:59 +00:00
adadelta.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
adadelta.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
adagrad.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
adagrad.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
adam.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
adam.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
adamax.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
adamax.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
adamw.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
adamw.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
asgd.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
asgd.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
lbfgs.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
lbfgs.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
lr_scheduler.py Correct OneCycleLR doc example code to explicitly call optimizer.step() (#95730) 2023-03-01 02:15:50 +00:00
lr_scheduler.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
nadam.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
nadam.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
optimizer.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
optimizer.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
radam.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
radam.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
rmsprop.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
rmsprop.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
rprop.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
rprop.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
sgd.py [optim] Widen the cases for defaulting to foreach (#95820) 2023-03-02 04:15:33 +00:00
sgd.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
sparse_adam.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
sparse_adam.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00
swa_utils.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
swa_utils.pyi [3/3] Update .pyi Python stub files and enable 'UFMT' linter (#95268) 2023-03-01 23:50:56 +00:00