pytorch/torch
joncrall d05f2ae476 Require DOCTEST_SHOW environ to run plt.show (#96522)
@ezyang This is a minor change.

I was using the doctests to check that my install wasn't broken via:

```bash
xdoctest -m torch --style=google --global-exec "from torch import nn\nimport torch.nn.functional as F\nimport torch" --options="+IGNORE_WHITESPACE"
```

And noticed that it stops in the middle to show this matplotlib figure. I added a condition so it only does the pyplot show if a DOCTEST_SHOW environment variable exists. With this fix the above command runs to completion and is an easy way for users to put torch through its paces given just a fresh install.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96522
Approved by: https://github.com/ezyang
2023-03-10 21:47:20 +00:00
..
_awaits [jit] Support Awaitable type (#90863) 2023-01-30 17:38:59 +00:00
_C Correctly resolve dispatch keys for PyOperator (#96306) 2023-03-09 22:16:31 +00:00
_C_flatbuffer
_decomp [inductor] Add some simple decomps (#96039) 2023-03-05 17:07:56 +00:00
_dispatch
_dynamo [QOL] Raise a NameError when accessing non-existent variable (#96418) 2023-03-10 17:54:02 +00:00
_export [aot autograd] merge all outputs of funtionalization analysis into single metadata (#95991) 2023-03-08 16:22:54 +00:00
_functorch Assert that there are no None arguments to backwards (#96300) 2023-03-09 22:14:39 +00:00
_inductor reland #96249: [inductor] show more kernel specific metrics in the benchmark result (#96461) 2023-03-10 06:18:21 +00:00
_lazy
_prims Update nvfuser_executor.py (#96218) 2023-03-08 22:07:58 +00:00
_prims_common Add support for nonzero, some improvements to reduce guards (#95387) 2023-02-24 00:27:45 +00:00
_refs [primTorch] move diagonal & add linalg.diagonal refs (#95774) 2023-03-06 17:59:47 +00:00
_subclasses Use maxint to bound integers. (#96121) 2023-03-07 12:46:19 +00:00
amp [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
ao pt2e short term quant: respect qmin/qmax for linear weight (#96232) 2023-03-10 04:46:20 +00:00
autograd [Autograd] expand_as instead of clone to get AccumulateGrad (#96356) 2023-03-09 21:58:42 +00:00
backends enable taskset core pinning in addition to numactl (#96011) 2023-03-07 01:19:46 +00:00
contrib
cpu
csrc Revert "[PyTorch] Use c10::FastMap for memoizing in Pickler (#96360)" (#96547) 2023-03-10 20:57:06 +00:00
cuda Fix usages of contextmanager without finally (#96170) 2023-03-08 20:59:27 +00:00
distributed [SPMD] Add defunctionalize_optimizer feature (#96323) 2023-03-10 16:05:23 +00:00
distributions Fix gumbel cdf (#91698) 2023-03-07 23:04:47 +00:00
fft
func [functorch] linearize (#94173) 2023-02-09 15:45:08 +00:00
futures
fx Reduce pytest blocklist part 2 (#96397) 2023-03-10 19:10:43 +00:00
jit Revert "Optimize nn.Module __call__ fast path for dynamo (#95931)" (#96242) 2023-03-10 01:05:01 +00:00
legacy
lib Simplify cmake code (#91546) 2023-02-08 01:05:19 +00:00
linalg
masked std/var: support floating point correction value (#94073) 2023-02-23 05:50:45 +00:00
monitor
mps [MPS] Enable Memory Leak Detection for test_mps.py (#94646) 2023-02-13 17:56:24 +00:00
multiprocessing [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
nested
nn Adding nn.ZeroPad1d and nn.ZeroPad3d (#96295) 2023-03-10 03:51:41 +00:00
onnx [ONNX] Preserve stacktrace info for decomp (#95929) 2023-03-10 21:07:03 +00:00
optim Fix wrong handling of grad_scale & found_inf in fused optimizers (#95847) 2023-03-04 01:21:21 +00:00
package [BE] Add flake8-logging-format linter (#94840) 2023-02-15 17:54:50 +00:00
profiler [Profiler] Add export_memory_timeline to save memory timeline plot to file (#96137) 2023-03-10 18:20:25 +00:00
quantization AO migration: replace torch internal callsites (#94170) 2023-02-07 02:32:23 +00:00
signal
sparse new triton main pin (#95896) 2023-03-10 06:30:41 +00:00
special
testing Adding nn.ZeroPad1d and nn.ZeroPad3d (#96295) 2023-03-10 03:51:41 +00:00
utils [DataPipe] Add copy option to fork DataPipe (#96030) 2023-03-10 17:31:56 +00:00
__config__.py
__future__.py
__init__.py Don't guard on the exact int value on conversion to bool (#96008) 2023-03-07 00:40:06 +00:00
_appdirs.py
_classes.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
_deploy.py
_guards.py Context manager to push/pop frame summaries (#96054) 2023-03-08 04:01:49 +00:00
_jit_internal.py Fix usages of contextmanager without finally (#96170) 2023-03-08 20:59:27 +00:00
_linalg_utils.py Remove deprecated torch.symeig (#70988) 2023-01-31 11:59:11 +00:00
_lobpcg.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
_lowrank.py
_meta_registrations.py [SDPA] Add an optional scale kwarg (#95259) 2023-03-08 18:07:40 +00:00
_namedtensor_internals.py
_ops.py Correctly resolve dispatch keys for PyOperator (#96306) 2023-03-09 22:16:31 +00:00
_python_dispatcher.py
_sources.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
_storage_docs.py
_tensor_docs.py Add further info to masked_scatter and masked_scatter_ documention (#94545) 2023-02-15 07:50:47 +00:00
_tensor_str.py [BE] Remove dependency on six and future (#94709) 2023-02-14 09:14:14 +00:00
_tensor.py Add HPU to compatible shallow copy list and remove lazy HPU changes (#94673) 2023-02-14 17:15:25 +00:00
_torch_docs.py docs: Match open bracket with close bracket in unsqueeze (#95215) 2023-02-24 03:56:59 +00:00
_utils_internal.py
_utils.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
_VF.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
_vmap_internals.py
_weights_only_unpickler.py Add float to list of allowed ops (#94910) 2023-02-15 23:13:21 +00:00
abi-check.cpp
CMakeLists.txt fix some tiny code issues (#95757) 2023-03-01 23:27:32 +00:00
custom_class_detail.h More tidy fixes (#93069) 2023-01-27 06:40:50 +00:00
custom_class.h More fixes and improved clang-tidy checkers (#93213) 2023-02-01 14:44:17 +00:00
extension.h
functional.py Require DOCTEST_SHOW environ to run plt.show (#96522) 2023-03-10 21:47:20 +00:00
hub.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
library.h
library.py
overrides.py Reland "Add torch.empty_permuted (#95069)" (#95208) 2023-02-21 18:02:48 +00:00
py.typed
quasirandom.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
random.py [MPS] Add Python Module Bindings for the MPS backend (#94417) 2023-02-12 21:22:30 +00:00
README.txt
return_types.py
script.h
serialization.py Fix usages of contextmanager without finally (#96170) 2023-03-08 20:59:27 +00:00
storage.py [BE] [2/3] Rewrite super() calls in functorch and torch (#94588) 2023-02-10 21:16:33 +00:00
torch_version.py
types.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00

Note [TH abstraction violation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TH/THC provide some hpp headers, which are proper C++ headers rather than
C headers.  These headers serve double duty as *internal implementation
detail* headers, whose contents should largely not be used by external
clients.

Ideally, we would not install these headers at all; instead, you should
use public functions (in headers like `THTensor.h`, NOT `THTensor.hpp`)
to manipulate these structs.  However, there are a few places
in torch/csrc where we violate this abstraction.  They are marked with
a pointer to this note.  Each of those sites will have to be refactored
when we refactor the guts of THTensor and related structures.