pytorch/torch
Michael Suo 8a170fbacd [package] fix mangling issues with TorchScript (#54915)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/54915

TorchScript and torch.package have different mangling schemes. To avoid
them interfering with each other, we should undo the torch.package
mangling before processing anything with TorchScript (since TS
independently makes sure that no names collide).

Test Plan: Imported from OSS

Reviewed By: SplitInfinity

Differential Revision: D27410472

Pulled By: suo

fbshipit-source-id: d1cc013c532d9abb7fb9615122bc465ded4785bb
2021-03-31 00:58:05 -07:00
..
_C Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
autograd docs: change to FloatTensor for requires_grad=True (#54658) 2021-03-29 10:25:56 -07:00
backends
contrib
csrc [package] fix mangling issues with TorchScript (#54915) 2021-03-31 00:58:05 -07:00
cuda docs: add reset_peak_memory_stats in cuda.rst (#54668) 2021-03-29 10:05:20 -07:00
distributed Clang-format powerSGD_hook.py (#54839) 2021-03-30 09:28:45 -07:00
distributions Remove legacy constructor calls from _torch_ folder. (#53889) 2021-03-19 15:20:19 -07:00
fft
for_onnx
futures Ensure torch.futures.wait_all exits early on error. (#53953) 2021-03-25 07:39:14 -07:00
fx Improve placeholder matching in subgraph rewriter (#54958) 2021-03-30 11:40:33 -07:00
jit [package] fix mangling issues with TorchScript (#54915) 2021-03-31 00:58:05 -07:00
legacy
lib [NCCL][Blocking Wait] Log set exceptions when checking for exceptions in (#54558) 2021-03-29 14:15:45 -07:00
linalg Added torch.linalg.matrix_power (#52608) 2021-03-23 15:10:06 -07:00
multiprocessing Make SharedCache thread-safe (#53750) 2021-03-25 06:35:03 -07:00
nn Fix ConvTranspose with padding as a list of values (#54911) 2021-03-30 07:37:31 -07:00
onnx docs: fix docstring signature of torch.{onnx,utils} (#54662) 2021-03-29 10:07:42 -07:00
optim Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
package [package] rename PackageExporter.external to PacakgeExporter.extern_modules (#54601) 2021-03-25 11:50:07 -07:00
profiler
quantization [quant][fx] Add pass in convert to fold quant-dequant sequence (#54860) 2021-03-30 08:40:24 -07:00
sparse
special [special] Alias for special.expm1 and special.exp2 (#54670) 2021-03-30 10:03:13 -07:00
testing [package] fix mangling issues with TorchScript (#54915) 2021-03-31 00:58:05 -07:00
utils docs: fix docstring signature of torch.{onnx,utils} (#54662) 2021-03-29 10:07:42 -07:00
__config__.py
__future__.py
__init__.py [codemod] fix tautological imports 2021-03-27 01:15:57 -07:00
_appdirs.py
_autograd_functions.py lu_backward: more numerically stable and with complex support. (#53994) 2021-03-25 13:33:58 -07:00
_classes.py
_deploy.py
_jit_internal.py [package] fix mangling issues with TorchScript (#54915) 2021-03-31 00:58:05 -07:00
_linalg_utils.py
_lobpcg.py
_lowrank.py
_namedtensor_internals.py
_ops.py
_python_dispatcher.py Rename DefaultBackend to CompositeExplicitAutograd (#54470) 2021-03-26 10:53:30 -07:00
_six.py
_storage_docs.py
_tensor.py Fix override for __iter__ (#54702) 2021-03-30 08:30:50 -07:00
_tensor_docs.py docs: remove extra backticks in narrow_copy (#54669) 2021-03-29 10:38:21 -07:00
_tensor_str.py
_torch_docs.py [special] Alias for special.expm1 and special.exp2 (#54670) 2021-03-30 10:03:13 -07:00
_utils.py Merge CUDA Streams and Events (#53902) 2021-03-26 14:19:39 -07:00
_utils_internal.py
_VF.py
_vmap_internals.py
abi-check.cpp
CMakeLists.txt
custom_class.h [PyTorch][easy] Move more strings in torch::class_ (#54547) 2021-03-29 12:27:11 -07:00
custom_class_detail.h
deploy.h Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
extension.h
functional.py lu_backward: more numerically stable and with complex support. (#53994) 2021-03-25 13:33:58 -07:00
hub.py Only allow hub.load() from original repo. (#54451) 2021-03-22 20:27:54 -07:00
library.h
overrides.py [special] Alias for special.expm1 and special.exp2 (#54670) 2021-03-30 10:03:13 -07:00
py.typed
quasirandom.py
random.py
README.txt
script.h Revert D26973911: Implement public API InferenceMode and its error handling 2021-03-29 11:17:49 -07:00
serialization.py docs: reference links to serialization.html (#54659) 2021-03-29 10:15:07 -07:00
storage.py
types.py

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.