Skip to content

Commit

Permalink
add use_buffers to swa_utils interface (#541)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #541

X-link: pytorch/pytorch#109078

As title, this already exists in swa_utils.py

Reviewed By: daniellepintz

Differential Revision: D49155243

fbshipit-source-id: df0e071247fa79d34eefae624bf46b896c62cb10
  • Loading branch information
galrotem authored and facebook-github-bot committed Sep 19, 2023
1 parent e2cd2c2 commit 9d6cd91
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions torchtnt/framework/auto_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ def __call__(self, *args, **kwargs):

if x.swa_params:
if not x.swa_params.avg_fn:
# pyre-ignore: Unexpected keyword [28]
x.swa_model = AveragedModel(x.module, use_buffers=True)
else:
# pyre-ignore: Unexpected keyword [28]
x.swa_model = AveragedModel(
x.module, avg_fn=x.swa_params.avg_fn, use_buffers=True
)
Expand Down

0 comments on commit 9d6cd91

Please sign in to comment.