Skip to content

Commit

Permalink
Merge pull request #2852 from chainer/check-none-hyperparam-proxy-des…
Browse files Browse the repository at this point in the history
…criptor

Check for None in HyperparameterProxy descriptor
  • Loading branch information
unnonouno committed Jun 14, 2017
1 parent f9df37e commit 283dc68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chainer/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ def __init__(self, attr_name):
self.__doc__ = 'Alias to ``self.hyperparam.{}``'.format(attr_name)

def __get__(self, obj, type=None):
if obj is None:
return self
return getattr(obj.hyperparam, self._attr_name)

def __set__(self, obj, value):
Expand Down

0 comments on commit 283dc68

Please sign in to comment.