lightning/docs
Rohit Gupta d1a3a3ebf5
Add BatchSizeFinder callback (#11089)
* add BatchSizeFinderCallback callback

* temp rm from init

* skip with lr_finder tests

* restore loops and intergrate early exit

* enable fast_dev_run test

* add docs and tests

* keep tune and remove early_exit

* add more tests

* patch lr finder

* disable skip

* force_save and fix test

* mypy and circular import fix

* fix mypy

* fix

* updates

* rebase

* address reviews

* add more exceptions for unsupported functionalities

* move exception to setup

* chlog

* unit test

* address reviews

* Apply suggestions from code review

* update

* update

* mypy

* fix

* use it as a util func

* license

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* mypy

* mypy

* review

* fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

* updates

* updates

* fix import

* Protect callback attrs

* don't reset val dataloader

* update test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: otaj <6065855+otaj@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2022-09-27 08:54:37 -04:00
..
source-app Updated the structure and applied feedback (#14734) 2022-09-22 11:40:12 +02:00
source-lit Removes the old HPO content (#14754) 2022-09-19 09:25:57 -04:00
source-pytorch Add BatchSizeFinder callback (#11089) 2022-09-27 08:54:37 -04:00
README.md Update docs README on how to build docs (#13465) 2022-07-17 18:48:10 +00:00
create-symlinks.py prepare space for fused docs (#14160) 2022-08-30 09:25:05 -04:00

README.md

PyTorch-Lightning Docs

We are using Sphinx with Napoleon extension. Moreover, we set Google style to follow with type convention.

See following short example of a sample function taking one position string and optional

from typing import Optional


def my_func(param_a: int, param_b: Optional[float] = None) -> str:
    """Sample function.

    Args:
        param_a: first parameter
        param_b: second parameter

    Return:
        sum of both numbers

    Example::

        >>> my_func(1, 2)
        3

    Note:
        If you want to add something.
    """
    p = param_b if param_b else 0
    return str(param_a + p)

Building Docs

When updating the docs, make sure to build them first locally and visually inspect the html files in your browser for formatting errors. In certain cases, a missing blank line or a wrong indent can lead to a broken layout. Run these commands

git submodule update --init --recursive
make docs

and open docs/build/html/index.html in your browser.

When you send a PR the continuous integration will run tests and build the docs. You can access a preview of the html pages in the Artifacts tab in CircleCI when you click on the task named build-Docs of ci-tests at the bottom of the PR page.

Notes:

  • You need to have LaTeX installed for rendering math equations. You can for example install TeXLive with the necessary extras by doing one of the following:
    • on Ubuntu (Linux) run sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
    • use the RTD docker image
  • You need to have pandoc installed for rendering Jupyter Notebooks. On Ubuntu (Linux), you can run: sudo apt-get install pandoc

Developing docs

When developing the docs, building docs can be VERY slow locally because of the notebook tutorials. To speed this up, enable this flag in before building docs:

# builds notebooks which is slow
export PL_FAST_DOCS_DEV=0

# fast notebook build which is fast
export PL_FAST_DOCS_DEV=1

docs CSS/theme

To change the CSS theme of the docs, go here. Apologies in advance... this is a bit complex to build and requires basic understanding of javascript/npm.