Skip to content

Commit

Permalink
FIX doctest format in TransformUpdateExtraArgsFn
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 609652416
  • Loading branch information
fabianp authored and OptaxDev committed Feb 23, 2024
1 parent bd3e5c8 commit 623609c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions optax/_src/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ def __call__(
For example, an update function that requires an additional loss parameter
(which might be useful for implementing learning rate schedules that depend
on the current loss value) could be expressed as follows.
on the current loss value) could be expressed as follows:
>>> def update(updates, state, params=None, *, loss, **extra_args):
>>> del extra_args
>>> # use loss value
... del extra_args
... # use loss value
Note that the loss value is keyword only, (it follows a `*` in the
signature of the function). This means users will get explicit errors if
Note that the loss value is keyword only, (it follows a ``*`` in the
signature of the function). This implies users will get explicit errors if
they try to use this gradient transformation without providing the required
argument.
Expand Down

0 comments on commit 623609c

Please sign in to comment.