Skip to content

Commit 8c653e0

Browse files
mattipfacebook-github-bot
authored andcommittedJul 29, 2020
DOC: fail to build if there are warnings (pytorch#41335)
Summary: Merge after pytorchgh-41334 and pytorchgh-41321 (EDIT: both are merged). Closes pytorchgh-38011 This is the last in a series of PRs to build documentation without warnings. It adds `-WT --keepgoing` to the shpinx build which will [fail the build if there are warnings](https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-W), print a [trackeback on error](https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-T) and [finish the build](https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-keep-going) even when there are warnings. It should fail now, but pass once the PRs mentioned at the top are merged. Pull Request resolved: pytorch#41335 Reviewed By: pbelevich Differential Revision: D22794425 Pulled By: mruberry fbshipit-source-id: eb2903e50759d1d4f66346ee2ceebeecfac7b094
1 parent 4b108ca commit 8c653e0

File tree

7 files changed

+9
-16
lines changed

7 files changed

+9
-16
lines changed
 

‎.circleci/scripts/python_doc_push_script.sh

+1-9
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,13 @@ export PATH=/opt/conda/bin:$PATH
5050

5151
rm -rf pytorch || true
5252

53-
# Install TensorBoard in python 3 so torch.utils.tensorboard classes render
54-
pip install -q https://s3.amazonaws.com/ossci-linux/wheels/tensorboard-1.14.0a0-py3-none-any.whl
55-
5653
# Get all the documentation sources, put them in one place
5754
pushd "$pt_checkout"
58-
checkout_install_torchvision
5955
pushd docs
60-
rm -rf source/torchvision
61-
cp -a ../vision/docs/source source/torchvision
6256

6357
# Build the docs
64-
pip -q install -r requirements.txt || true
58+
pip -q install -r requirements.txt
6559
if [ "$is_master_doc" = true ]; then
66-
# TODO: fix gh-38011 then enable this which changes warnings into errors
67-
# export SPHINXOPTS="-WT --keep-going"
6860
make html
6961
make coverage
7062
# Now we have the coverage report, we need to make sure it is empty.

‎docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS ?= -j auto
5+
SPHINXOPTS ?= -j auto -WT --keep-going
66
SPHINXBUILD ?= sphinx-build
77
SPHINXPROJ ?= PyTorch
88
SOURCEDIR ?= source

‎docs/source/jit.rst

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Creating TorchScript Code
5050
wait
5151
ScriptModule
5252
ScriptFunction
53-
freeze
5453
save
5554
load
5655
ignore

‎docs/source/optim.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ normalization statistics at the end of training.
187187

188188
SWA has been proposed in `Averaging Weights Leads to Wider Optima and Better Generalization`_.
189189

190-
.. _`Averaging Weights Leads to Wider Optima and Better Generalization` https://arxiv.org/abs/1803.05407
190+
.. _`Averaging Weights Leads to Wider Optima and Better Generalization`: https://arxiv.org/abs/1803.05407
191191

192192
Constructing averaged models
193193
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

‎torch/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def set_default_tensor_type(t):
272272
def set_default_dtype(d):
273273
r"""Sets the default floating point dtype to :attr:`d`.
274274
This dtype is:
275+
275276
1. The inferred dtype for python floats in :func:`torch.tensor`.
276277
2. Used to infer dtype for python complex numbers. The default complex dtype is set to
277278
``torch.complex128`` if default floating point dtype is ``torch.float64``,
@@ -282,7 +283,7 @@ def set_default_dtype(d):
282283
Args:
283284
d (:class:`torch.dtype`): the floating point dtype to make the default
284285
285-
Example::
286+
Example:
286287
>>> # initial default for floating point is torch.float32
287288
>>> torch.tensor([1.2, 3]).dtype
288289
torch.float32

‎torch/functional.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,8 @@ def atleast_3d(*tensors):
10631063
Returns:
10641064
output (Tensor or tuple of Tensors)
10651065
1066-
Example::
1066+
Example:
1067+
10671068
>>> x = torch.tensor(0.5)
10681069
>>> x
10691070
tensor(0.5000)
@@ -1076,7 +1077,7 @@ def atleast_3d(*tensors):
10761077
>>> torch.atleast_3d(y)
10771078
tensor([[[-0.8079],
10781079
[ 0.7460]],
1079-
1080+
<BLANKLINE>
10801081
[[-1.1647],
10811082
[ 1.4734]]])
10821083
>>> x = torch.randn(1,1,1)

‎torch/serialization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def save(obj, f: Union[str, os.PathLike, BinaryIO],
334334
pickle_module=pickle, pickle_protocol=DEFAULT_PROTOCOL, _use_new_zipfile_serialization=True) -> None:
335335
"""Saves an object to a disk file.
336336
337-
See also: :ref:`recommend-saving-models`
337+
See also: `saving-loading-tensors`
338338
339339
Args:
340340
obj: saved object

0 commit comments

Comments
 (0)
Please sign in to comment.