pytorch/torch
Vasiliy Kuznetsov ab8a99bd36 graph mode: add hardswish inplace handling (#40284)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40284

Adds graph mode handling for inplace hardswish, and test coverage for functional hardswish.

Test Plan:
```
python test/test_quantization.py TestQuantizeScriptPTSQOps.test_hardswish
```

Imported from OSS

Differential Revision: D22140628

fbshipit-source-id: 55a514f7dc1130d510f69ee4e611d7cb5e08d02e
2020-06-21 09:40:50 -07:00
..
_C Add typing for _CudaStreamBase and _CudaEventBase classes (#40256) 2020-06-19 11:29:41 -07:00
autograd Allow profiler to be enabled remotely with RPC (#38748) 2020-06-18 17:01:57 -07:00
backends Fix torch.backends.cudnn mypy error (#38947) 2020-06-03 10:55:43 -07:00
contrib Add --check-untyped-defs to mypy.ini and test suite (#37594) 2020-05-07 06:36:01 -07:00
csrc graph mode: add hardswish inplace handling (#40284) 2020-06-21 09:40:50 -07:00
cuda Move torch.cuda annotations inline (#40075) 2020-06-18 15:52:29 -07:00
distributed Add a warning to mention that async_execution does not work with autograd profiler (#40309) 2020-06-19 15:35:00 -07:00
distributions Replace torch.is_tensor usages with isinstance checks. (#38062) 2020-05-08 10:10:11 -07:00
for_onnx
futures Improve torch.futures docs (#40245) 2020-06-18 18:47:25 -07:00
jit [JIT] Add support for with statements (#34705) 2020-06-18 16:57:18 -07:00
legacy
lib [Resubmit] Ensure NCCL_BLOCKING_WAIT=1 works for dist.barrier() (#40249) 2020-06-19 15:42:43 -07:00
multiprocessing Remove (most) Python 2 support from Python code (#35615) 2020-04-22 09:23:14 -07:00
nn quantized elu: eager mode QAT handling (#40104) 2020-06-21 09:40:46 -07:00
onnx [ONNX] Update black_listed_operators for opset 12 (#39414) 2020-06-19 13:33:25 -07:00
optim Make Optimizer.state_dict() nondeterministic (#37347) 2020-06-01 15:32:02 -07:00
quantization quantized elu: eager mode QAT handling (#40104) 2020-06-21 09:40:46 -07:00
sparse Sparse softmax support (CPU) (#36305) 2020-05-14 08:08:40 -07:00
testing graph mode: add hardswish inplace handling (#40284) 2020-06-21 09:40:50 -07:00
utils Add optimization blacklist as second arg to optimizeForMobile method. (#37462) 2020-06-17 18:14:45 -07:00
__config__.py
__future__.py
__init__.py Add experimental deterministic flag (#38683) 2020-06-12 08:44:06 -07:00
_appdirs.py Delete Python <= 3.5 specific checks from the code (#39879) 2020-06-15 08:16:06 -07:00
_classes.py
_jit_internal.py Back out "[pytorch][PR] [JIT] Infer NamedTuple type attributes of nn.Modules correctly" (#40270) 2020-06-19 02:58:31 -07:00
_linalg_utils.py Fix type annotations and make MyPy run on torch/ (#36584) 2020-04-22 14:17:08 -07:00
_lobpcg.py Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
_lowrank.py Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
_namedtensor_internals.py Remove (most) Python 2 support from Python code (#35615) 2020-04-22 09:23:14 -07:00
_ops.py
_overrides.py quant layer/group/instance norm: make weights and biases optional (#39203) 2020-06-18 10:19:39 -07:00
_six.py Delete Python <= 3.5 specific checks from the code (#39879) 2020-06-15 08:16:06 -07:00
_storage_docs.py Python API for Complex Storage and storage copy logic (#35771) 2020-05-01 11:47:22 -07:00
_tensor_docs.py Fix Tensor.tolist signature in the docstring (#39732) 2020-06-10 22:00:14 -07:00
_tensor_str.py disable autograd while preparing Tensor for printing (#39420) 2020-06-05 16:57:48 -07:00
_torch_docs.py Throws runtime error when performing integer division using torch.div (#38620) 2020-06-10 13:59:34 -07:00
_utils_internal.py Separate RTLD_GLOBAL from _load_global_deps() (#36682) 2020-04-22 19:08:44 -07:00
_utils.py
_VF.py Delete torch/__init__.pyi, deferring to direct extension stubs (#38157) 2020-05-11 07:20:13 -07:00
abi-check.cpp
CMakeLists.txt Move all torch.nn.modules type annotations inline (#38211) 2020-06-11 15:59:57 -07:00
custom_class_detail.h Test BC for built-in torchbind methods (#38560) 2020-05-15 19:06:59 -07:00
custom_class.h [JIT] Add Type::repr_str to return human-readable str (#39544) 2020-06-10 12:01:24 -07:00
extension.h
functional.py [Docs] Update torch.(squeeze, split, set_printoptions, save) docs. (#39303) 2020-06-05 12:57:53 -07:00
hub.py Add file_name argument to load_state_dict_from_url (#39749) 2020-06-12 10:31:22 -07:00
library.h Assert that kernels are called with the right signature (#40251) 2020-06-18 21:54:05 -07:00
py.typed
quasirandom.py
random.py
README.txt
script.h
serialization.py Switch torch.save to zipfile serialization and swap quantization to that (#39460) 2020-06-10 17:19:55 -07:00
storage.py [testing] Dont use zipfile for storage __reduce__ (#39893) 2020-06-12 16:48:12 -07:00
tensor.py Back out "[pytorch][PR] Removes dunder div" 2020-06-19 18:31:20 -07:00
types.py Device and torch._C function cleanup (#38173) 2020-06-03 19:17:22 -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.