mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
End of the .data removal in torch/optim (#34211)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34211 Test Plan: Imported from OSS Differential Revision: D20248684 Pulled By: albanD fbshipit-source-id: 2294bfa41b82ff47f000bc98860780f59d7d4421
This commit is contained in:
committed by
Facebook Github Bot
parent
7e55494502
commit
6e2bb1c054
@ -101,7 +101,6 @@ class SparseAdam(Optimizer):
|
||||
bias_correction2 = 1 - beta2 ** state['step']
|
||||
step_size = group['lr'] * math.sqrt(bias_correction2) / bias_correction1
|
||||
|
||||
# Need to avoid version tracking for parameter.
|
||||
p.data.add_(make_sparse(-step_size * numer.div_(denom)))
|
||||
p.add_(make_sparse(-step_size * numer.div_(denom)))
|
||||
|
||||
return loss
|
||||
|
Reference in New Issue
Block a user