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:
Adam Paszke
2017-03-30 07:25:32 -07:00
committed by Soumith Chintala
parent de9998e198
commit 20aa5b066f
20 changed files with 971 additions and 758 deletions

View File

@ -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).