pytorch/torch
Edward Yang 173f224570 Turn on F401: Unused import warning. (#18598)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18598
ghimport-source-id: c74597e5e7437e94a43c163cee0639b20d0d0c6a

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18598 Turn on F401: Unused import warning.**

This was requested by someone at Facebook; this lint is turned
on for Facebook by default.  "Sure, why not."

I had to noqa a number of imports in __init__.  Hypothetically
we're supposed to use __all__ in this case, but I was too lazy
to fix it.  Left for future work.

Be careful!  flake8-2 and flake8-3 behave differently with
respect to import resolution for # type: comments.  flake8-3 will
report an import unused; flake8-2 will not.  For now, I just
noqa'd all these sites.

All the changes were done by hand.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Differential Revision: D14687478

fbshipit-source-id: 30d532381e914091aadfa0d2a5a89404819663e3
2019-03-30 09:01:17 -07:00
..
_thnn Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
autograd Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
backends Add ability to query if built with CUDA and MKL-DNN. (#18362) 2019-03-25 10:39:09 -07:00
contrib Remove stages from IR, they are not longer used 2018-10-05 13:58:15 -07:00
csrc Attribute serialization improvements (#18188) 2019-03-29 19:10:12 -07:00
cuda Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
distributed Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
distributions Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
for_onnx Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
jit Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
legacy Remove torch/legacy (#11823) 2018-09-20 14:00:54 -07:00
lib Fix NCCL/Gloo process groups and DDP stream sync bug (#18465) 2019-03-28 15:12:40 -07:00
multiprocessing Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
nn Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
onnx Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
optim Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
sparse Correct conv and pooling docstrings in nn module (#17052) 2019-02-15 06:58:02 -08:00
testing Lightweight String check Utility (#16858) 2019-02-19 12:31:57 -08:00
utils Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
__init__.py Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
__init__.pyi.in Rename btrifact* to lu (#18435) 2019-03-29 00:34:30 -07:00
_jit_internal.py Upgrade flake8-bugbear to master, fix the new lints. (#18507) 2019-03-27 08:07:41 -07:00
_ops.py Override the resolve_library_path in FBCode (#17497) 2019-03-12 22:09:24 -07:00
_six.py Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
_storage_docs.py Bool tensor. Part 0: Boolean storage implementation (#16810) 2019-02-19 08:22:13 -08:00
_tensor_docs.py Rename btrifact* to lu (#18435) 2019-03-29 00:34:30 -07:00
_tensor_str.py Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
_torch_docs.py Fixed torch.arange docs (#18604) 2019-03-29 06:42:28 -07:00
_utils_internal.py Override the resolve_library_path in FBCode (#17497) 2019-03-12 22:09:24 -07:00
_utils.py create type hint stub files for module torch (#12500) 2019-01-29 12:14:17 -08:00
abi-check.cpp Fixes for Torch Script C++ API (#11682) 2018-09-17 09:54:50 -07:00
CMakeLists.txt Experimental logging/counters API (#18235) 2019-03-29 17:14:03 -07:00
extension.h Remove deprecated variable_tensor_functions (#15003) 2018-12-11 17:16:11 -08:00
functional.py Rename btriunpack to lu_unpack (#18529) 2019-03-29 13:01:30 -07:00
hub.py Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
quasirandom.py Introduce SobolEngine (#10505) 2019-03-26 07:53:07 -07:00
random.py Turn on F401: Unused import warning. (#18598) 2019-03-30 09:01:17 -07:00
README.txt
script.h Use torch:: instead of at:: in all C++ APIs (#13523) 2018-11-06 14:32:25 -08:00
serialization.py Serialization supports pathlib.Path object for the input argument (#18562) 2019-03-28 21:01:15 -07:00
storage.py Bool tensor. Part 0: Boolean storage implementation (#16810) 2019-02-19 08:22:13 -08:00
tensor.py Rename btrifact* to lu (#18435) 2019-03-29 00:34:30 -07: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.