pytorch/torch
Vasiliy Kuznetsov 72c943a2ac ns for fx: fix bug for user function in weight extraction (#62333)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62333

We incorrectly ignored any custom relationships the user specified
in the `extract_weights` API.  Fixing this and adding a test case.

Test Plan:
```
python test/test_quantization.py TestFXNumericSuiteCoreAPIs.test_user_defined_function
```

Imported from OSS

Reviewed By: hx89

Differential Revision: D29963502

fbshipit-source-id: 33ce3d4df1acb6298b6c7dcb6674015c8d14bdf4
2021-07-28 16:05:51 -07:00
..
_C [pytorch] Bring back RemoveInplaceOps() (#62200) 2021-07-28 12:00:38 -07:00
ao [pruner] add Conv2d support (#61778) 2021-07-22 23:00:31 -07:00
autograd Add forward AD inplace check and fix codegen (#60498) 2021-07-27 13:04:55 -07:00
backends [8/N] Nnapi backend delegation preprocess: New refactored design (#62225) 2021-07-27 18:52:48 -07:00
contrib
cpu
csrc irange-ify 10 (#62122) 2021-07-28 13:35:23 -07:00
cuda Don't split oversize cached blocks (#44742) 2021-06-21 11:46:08 -07:00
distributed [Model Averaging] Create a base class for model averaging (#62111) 2021-07-28 10:15:36 -07:00
distributions Improve error message on invalid values to Distribution methods (#61056) 2021-07-06 15:44:55 -07:00
fft Fix FFT documentation examples and run doctests in the test suite (#60304) 2021-06-21 20:47:25 -07:00
for_onnx
futures fix torch.futures docstring examples (#61029) 2021-07-07 11:47:55 -07:00
fx Teach pytrees about namedtuple (#62292) 2021-07-28 06:27:44 -07:00
jit enable check trace when tracing a mkldnn model (#61241) 2021-07-19 11:03:53 -07:00
legacy
lib Disable avoid-non-const-global-variables lint check (#62008) 2021-07-22 18:04:40 -07:00
linalg Svd docfix (#62028) 2021-07-22 14:11:52 -07:00
multiprocessing
nn ENH Adds no_batch_dim support for pad 2d and 3d (#62183) 2021-07-28 11:10:44 -07:00
onnx [ONNX] Enable aten:normal op and add tests for aten:uniform op. (#60441) (#61560) 2021-07-21 15:10:35 -07:00
optim Fix CosineAnnealingWarmRestart annotation (#61106) 2021-07-09 08:28:18 -07:00
package Revert D29639797: [package] error if we try to mock a module in 3.6 2021-07-09 19:31:04 -07:00
profiler
quantization ns for fx: fix bug for user function in weight extraction (#62333) 2021-07-28 16:05:51 -07:00
sparse
special [special] alias for mvlgamma (#61633) 2021-07-23 11:24:27 -07:00
testing ENH Adds no_batch_dim support for pad 2d and 3d (#62183) 2021-07-28 11:10:44 -07:00
utils Teach pytrees about namedtuple (#62292) 2021-07-28 06:27:44 -07:00
__config__.py
__future__.py
__init__.py torch: Make __version__ better with comparisons (#61556) 2021-07-15 15:12:09 -07:00
_appdirs.py
_autograd_functions.py
_classes.py
_deploy.py Torch deploy for fx.grapm_module with non-torch dependencie (#61680) 2021-07-21 10:29:48 -07:00
_jit_internal.py Support RRefs that contain torch.cuda.Event (#61354) 2021-07-08 15:33:08 -07:00
_linalg_utils.py
_lobpcg.py Remove Optional[None] annotations (#60704) 2021-06-25 15:53:58 -07:00
_lowrank.py
_namedtensor_internals.py
_ops.py
_python_dispatcher.py Add device and key for lazy tensors (#61621) 2021-07-26 23:00:22 -07:00
_six.py
_storage_docs.py
_tensor_docs.py Add neg bit (#56058) 2021-07-13 13:50:42 -07:00
_tensor_str.py Add neg bit (#56058) 2021-07-13 13:50:42 -07:00
_tensor.py Hacky support for meta tensor serialization. (#62192) 2021-07-26 14:33:45 -07:00
_torch_docs.py Implement NumPy-like frombuffer tensor constructor. (#59077) 2021-07-23 13:17:48 -07:00
_utils_internal.py
_utils.py Hacky support for meta tensor serialization. (#62192) 2021-07-26 14:33:45 -07:00
_VF.py
_vmap_internals.py
abi-check.cpp
CMakeLists.txt [torch deploy] add support for Python C extension modules (#58117) 2021-07-23 19:58:54 -07:00
custom_class_detail.h
custom_class.h
deploy.h
extension.h
functional.py Allow dims=0 in torch.tensordot call (#61331) 2021-07-10 17:05:20 -07:00
hub.py Add option to skip GH validation for torch.hub (#62139) 2021-07-26 22:44:12 -07:00
library.h Add device and key for lazy tensors (#61621) 2021-07-26 23:00:22 -07:00
overrides.py Implement NumPy-like frombuffer tensor constructor. (#59077) 2021-07-23 13:17:48 -07:00
py.typed
quasirandom.py
random.py Improve documentation for torch.set_rng_state (#60422) 2021-06-22 07:10:50 -07:00
README.txt
script.h
serialization.py
storage.py
torch_version.py torch: Make __version__ better with comparisons (#61556) 2021-07-15 15:12:09 -07:00
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.