Skip to content

Commit

Permalink
Merge pull request #4167 from kmaehashi/fix-pydoc
Browse files Browse the repository at this point in the history
Update pydoc for Optimizer setup syntax sugar
  • Loading branch information
Crissman committed Feb 7, 2018
2 parents fca0e27 + 001f8c2 commit e93809c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chainer/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ def setup(self, link):
Args:
link (~chainer.Link): Target link object.
Returns:
The optimizer instance.
.. note::
As of v4.0.0, this function returns the optimizer instance itself
so that you can instantiate and setup the optimizer in one line,
e.g., ``optimizer = SomeOptimizer().setup(link)``.
"""
if not isinstance(link, link_module.Link):
raise TypeError('optimization target must be a link')
Expand Down

0 comments on commit e93809c

Please sign in to comment.