Skip to content

Commit

Permalink
Add documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
zerogerc committed Jul 21, 2020
1 parent c0f62bd commit 7542142
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pytorch_lightning/trainer/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class TrainerState(Enum):


def trainer_state(*, entering: Optional[TrainerState] = None, exiting: Optional[TrainerState] = None) -> Callable:
""" Decorator for :class:`~pytorch_lightning.Trainer` methods which changes
state to `entering` before the function execution and `exiting` after
the function is executed. If None is passed the state is not changed.
"""

def wrapper(fn) -> Callable:
@wraps(fn)
def wrapped_fn(self, *args, **kwargs):
Expand Down

0 comments on commit 7542142

Please sign in to comment.