Skip to content

Commit

Permalink
Use f-"""-string in a Trainer comment (#6377)
Browse files Browse the repository at this point in the history
* Use f-"""-string

* Add r

* Use Trainer.

* r -> noqa: W605
  • Loading branch information
carmocca committed Mar 6, 2021
1 parent 85c8074 commit 217470b
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,25 +449,28 @@ def fit(
# ----------------------------
# INSPECT THE CORE LOOPS
# ----------------------------
# Lightning internal flow looks like this.
#
# trainer.fit(...) or trainer.test(...) or trainer.predict(...) ||
# | ||
# create accelerator ||
# | ||
# trainer.dispatch || LIGHTNING
# | ||
# start_training or start_evaluating or start_predicting call || FLOW
# from `accelerator` ||
# | || DIRECTION
# run_train or run_evaluate or run_predict call ||
# from `trainer` ||
# | ||
# results \/
# This is used to guide readers to the core loops: train, test, predict.
# `run_predict` is the simplest to understand, use `Go to Definition` to read it :)
# Search for `start_training` or `start_evaluating` or `start_predicting` in
# `pytorch_lightning/plugins/training_type` folder to find accelerator dispatch functions.
f"""
Lightning internal flow looks like this:
{Trainer.fit} or {Trainer.test} or {Trainer.predict} ||
| ||
create accelerator ||
| ||
{self.dispatch} ||
| || LIGHTNING
{self.accelerator.start_training} or ||
{self.accelerator.start_evaluating} or || FLOW
{self.accelerator.start_predicting} ||
| || DIRECTION
{self.run_train} or ||
{self.run_evaluation} or ||
{self.run_predict} ||
| ||
results \/
This is used to guide readers to the core loops: train, test, predict.
{self.run_predict} is the simplest to understand, use `Go to Definition` to read it :)
Search for `start_training` or `start_evaluating` or `start_predicting` in
`pytorch_lightning/plugins/training_type_plugin` to find accelerator dispatch functions.
""" # noqa: W605

# ----------------------------
# TRAIN
Expand Down

0 comments on commit 217470b

Please sign in to comment.