mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Convert some of the functions to new format
Also, fix a lot of issues that appeared after the previous commits.
This commit is contained in:
committed by
Soumith Chintala
parent
de9998e198
commit
20aa5b066f
@ -134,6 +134,7 @@ class Optimizer(object):
|
||||
for param in group['params']:
|
||||
if param.grad is not None:
|
||||
param.grad.data.zero_()
|
||||
param.grad.detach_()
|
||||
|
||||
def step(self, closure):
|
||||
"""Performs a single optimization step (parameter update).
|
||||
|
Reference in New Issue
Block a user