Skip to content

Commit

Permalink
Merge pull request #2864 from chainer/v2-check-none-hyperparam-proxy-…
Browse files Browse the repository at this point in the history
…descriptor

[backport] Check for None in HyperparameterProxy descriptor
  • Loading branch information
niboshi committed Jun 15, 2017
2 parents eef0935 + 283dc68 commit bd49e73
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 bd49e73

Please sign in to comment.