Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Dec 13, 2020
1 parent 7195330 commit 65263b3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/source/amp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Native torch
When using PyTorch 1.6+ Lightning uses the native amp implementation to support 16-bit.

.. testcode::
:skipif: not APEX_AVAILABLE and not NATIVE_AMP_AVAILABLE
:skipif: not _APEX_AVAILABLE and not _NATIVE_AMP_AVAILABLE

# turn on 16-bit
trainer = Trainer(precision=16)
Expand Down Expand Up @@ -73,7 +73,7 @@ Enable 16-bit
^^^^^^^^^^^^^

.. testcode::
:skipif: not APEX_AVAILABLE and not NATIVE_AMP_AVAILABLE
:skipif: not _APEX_AVAILABLE and not _NATIVE_AMP_AVAILABLE

# turn on 16-bit
trainer = Trainer(amp_level='O2', precision=16)
Expand All @@ -88,7 +88,7 @@ TPU 16-bit
16-bit on TPUs is much simpler. To use 16-bit with TPUs set precision to 16 when using the TPU flag

.. testcode::
:skipif: not TPU_AVAILABLE
:skipif: not _TPU_AVAILABLE

# DEFAULT
trainer = Trainer(tpu_cores=8, precision=32)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def package_list_from_file(file):
_XLA_AVAILABLE,
_TPU_AVAILABLE,
)
TORCHVISION_AVAILABLE = importlib.util.find_spec("torchvision") is not None
_TORCHVISION_AVAILABLE = importlib.util.find_spec("torchvision") is not None
"""
Expand Down
4 changes: 2 additions & 2 deletions docs/source/introduction_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Data
Lightning operates on pure dataloaders. Here's the PyTorch code for loading MNIST.

.. testcode::
:skipif: not TORCHVISION_AVAILABLE
:skipif: not _TORCHVISION_AVAILABLE

from torch.utils.data import DataLoader, random_split
from torchvision.datasets import MNIST
Expand All @@ -153,7 +153,7 @@ Lightning operates on pure dataloaders. Here's the PyTorch code for loading MNIS

.. testoutput::
:hide:
:skipif: os.path.isdir(os.path.join(os.getcwd(), 'MNIST')) or not TORCHVISION_AVAILABLE
:skipif: os.path.isdir(os.path.join(os.getcwd(), 'MNIST')) or not _TORCHVISION_AVAILABLE

Downloading ...
Extracting ...
Expand Down
2 changes: 1 addition & 1 deletion docs/source/trainer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ If used on TPU will use torch.bfloat16 but tensor printing
will still show torch.float32.
.. testcode::
:skipif: not APEX_AVAILABLE and not NATIVE_AMP_AVAILABLE
:skipif: not _APEX_AVAILABLE and not _NATIVE_AMP_AVAILABLE
# default used by the Trainer
trainer = Trainer(precision=32)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/transfer_learning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Example: Imagenet (computer Vision)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. testcode::
:skipif: not TORCHVISION_AVAILABLE
:skipif: not _TORCHVISION_AVAILABLE

import torchvision.models as models

Expand Down

0 comments on commit 65263b3

Please sign in to comment.