Skip to content

Commit

Permalink
Fix docs typo (#4930)
Browse files Browse the repository at this point in the history
* Fix docs

* typo

* import

* Apply suggestions from code review

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: edenlightning <66261195+edenlightning@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
6 people committed Feb 5, 2021
1 parent 1c44f35 commit b2b27e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
12 changes: 12 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ def package_list_from_file(file):
from torch import nn
import pytorch_lightning as pl
<<<<<<< HEAD
from pytorch_lightning import LightningDataModule, LightningModule, Trainer
from pytorch_lightning.utilities import (
_NATIVE_AMP_AVAILABLE,
Expand All @@ -384,6 +385,17 @@ def package_list_from_file(file):
_TPU_AVAILABLE,
)
_TORCHVISION_AVAILABLE = importlib.util.find_spec("torchvision") is not None
=======
from pytorch_lightning import LightningModule, Trainer
from pytorch_lightning.utilities import (
NATIVE_AMP_AVAILABLE,
APEX_AVAILABLE,
XLA_AVAILABLE,
TPU_AVAILABLE,
_module_available,
)
TORCHVISION_AVAILABLE = _module_available("torchvision")
>>>>>>> d71659b4 (Fix docs typo (#4930))
"""
coverage_skip_undoc_in_source = True
14 changes: 7 additions & 7 deletions docs/source/starter/style_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ A LightningModule can define both a system and a model.

Here's a LightningModule that defines a model:

.. code-block:: python
.. testcode::

class LitModel(pl.LightningModule):
def __init__(self, num_layers: int = 3)
class LitModel(LightningModule):
def __init__(self, num_layers: int = 3):
super().__init__()
self.layer_1 = nn.Linear(...)
self.layer_2 = nn.Linear(...)
self.layer_3 = nn.Linear(...)
self.layer_1 = nn.Linear()
self.layer_2 = nn.Linear()
self.layer_3 = nn.Linear()

Here's a lightningModule that defines a system:
Here's a LightningModule that defines a system:

.. testcode::

Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/core/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ def save_hyperparameters(self, *args, frame=None) -> None:
Args:
args: single object of `dict`, `NameSpace` or `OmegaConf`
or string names or argumenst from class `__init__`
or string names or arguments from class `__init__`
>>> class ManuallyArgsModel(LightningModule):
... def __init__(self, arg1, arg2, arg3):
Expand Down

0 comments on commit b2b27e4

Please sign in to comment.