pytorch/test
Donny Greenberg 1bf3dc51ae [JIT] Add __prepare_scriptable__ duck typing to allow replacing nn.modules with scriptable preparations (#45645)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/45072

As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users.

Prior art by jamesr66a: https://github.com/pytorch/pytorch/pull/42244

cc: zhangguanheng66

Pull Request resolved: https://github.com/pytorch/pytorch/pull/45645

Reviewed By: dongreenberg, ngimel

Differential Revision: D24039990

Pulled By: zhangguanheng66

fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65
2020-11-10 08:59:45 -08:00
..
backward_compatibility [quant][pyper] Add support for pruned weights in embedding_bag_byte lookup (#47329) 2020-11-04 22:33:33 -08:00
benchmark_utils More Timer refinement (#46023) 2020-10-15 16:32:53 -07:00
bottleneck_test
cpp [NNC] Simplify and fix some bugs in Bounds Inference (#47450) 2020-11-09 21:37:04 -08:00
cpp_api_parity Support tuple inputs in NN Module test (#44853) 2020-09-28 22:05:05 -07:00
cpp_extensions Add barrier() at the end of init_process_group and new_group. (#45181) 2020-09-25 15:46:59 -07:00
custom_backend [JIT] Modify to_backend API so that it accepts wrapped modules (#43612) 2020-09-28 17:17:01 -07:00
custom_operator
distributed Revert D24574649: [pytorch][PR] Utility that loads a DP/DDP model state dict into a non-DDP model with the same architecture. 2020-11-10 06:55:45 -08:00
distributions Support pytest for distribution testing (#45648) 2020-10-13 10:56:50 -07:00
error_messages
expect
fx [FX] Track use nodes in Node (#45775) 2020-10-07 00:15:04 -07:00
jit [JIT] Add __prepare_scriptable__ duck typing to allow replacing nn.modules with scriptable preparations (#45645) 2020-11-10 08:59:45 -08:00
mobile PyTorch NNAPI integration prototype (#46780) 2020-11-05 21:31:01 -08:00
namespace_b
onnx [ONNX] Add export of aten::is_floating point (#46442) 2020-11-09 18:02:47 -08:00
optim
package_a
quantization [quant][qat] Ensure observer respects device affinity (#47514) 2020-11-10 08:43:52 -08:00
scripts
test_img
type_hint_tests
HowToWriteTestsUsingFileCheck.md
module_a.py
print_test_stats.py add workflow ID to report tags (#46725) 2020-10-23 12:10:54 -07:00
run_test.py Moving test order to rebalance test1 and test2 times (#47290) 2020-11-03 09:39:29 -08:00
simulate_nccl_errors.py
test_autograd.py Add complex autograd support for torch.mean (#47566) 2020-11-09 08:31:10 -08:00
test_bundled_images.py
test_bundled_inputs.py
test_complex.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py
test_cpp_extensions_jit.py
test_cuda.py [ROCm] enable stream priorities (#47136) 2020-11-02 11:25:44 -08:00
test_cuda_primary_ctx.py
test_dataloader.py add warning if DataLoader is going to create excessive number of thread (#46867) 2020-10-30 07:54:23 -07:00
test_determination.py
test_dispatch.py [WIP] Move catchAll to Math (#45939) 2020-10-16 16:17:16 -07:00
test_expecttest.py
test_foreach.py [WIP] Adding bunch of unary foreach APIs (#47383) 2020-11-09 14:14:28 -08:00
test_function_schema.py Stricter backward compatibility check (#45773) 2020-10-06 01:28:48 -07:00
test_functional_autograd_benchmark.py
test_futures.py fix #45552 - adding add_done_callback(fn) to torch.futures.Future (#45675) 2020-10-13 07:47:36 -07:00
test_fx.py [fx] add missing modules for type annoations (#47537) 2020-11-09 11:36:36 -08:00
test_fx_experimental.py Revert D24801481: [pytorch][PR] Add AcceleratedGraphModule and serialzie GraphModule to JSON 2020-11-09 08:28:22 -08:00
test_indexing.py
test_jit.py Correctly print out sign of near-zero double values (#47081) 2020-11-07 01:25:47 -08:00
test_jit_cuda_fuser.py [nvFuser] Switching to CudaFusionGuard from BailOut for nvfuser - update 2 (#46452) 2020-10-19 15:44:31 -07:00
test_jit_disabled.py
test_jit_fuser.py
test_jit_fuser_legacy.py Rename jobs and cli switches for testing GraphExecutor configurations to something a little bit more sensical. (#45715) 2020-10-05 11:43:28 -07:00
test_jit_fuser_te.py [pytorch][tensorexpr] Promote integer arguments to sin/cos/tan to float (#46776) 2020-10-23 17:32:54 -07:00
test_jit_legacy.py Rename jobs and cli switches for testing GraphExecutor configurations to something a little bit more sensical. (#45715) 2020-10-05 11:43:28 -07:00
test_jit_profiling.py Rename jobs and cli switches for testing GraphExecutor configurations to something a little bit more sensical. (#45715) 2020-10-05 11:43:28 -07:00
test_jit_py3.py [JIT] Add API for ignoring arbitrary module attributes (#45262) 2020-10-06 18:02:06 -07:00
test_jit_simple.py Rename jobs and cli switches for testing GraphExecutor configurations to something a little bit more sensical. (#45715) 2020-10-05 11:43:28 -07:00
test_jit_string.py
test_kernel_launch_checks.py Ensure kernel launches are checked (#46474) 2020-10-28 09:27:48 -07:00
test_linalg.py Revert D24730264: [pytorch][PR] Added CUDA support for complex input for torch.inverse 2020-11-06 07:28:14 -08:00
test_logging.py
test_metal.py [Metal] Add the Python binding for optimize_for_mobile (#46456) 2020-10-17 10:26:25 -07:00
test_mkldnn.py
test_mobile_optimizer.py Make add_relu an internal function (#46676) 2020-10-22 18:08:15 -07:00
test_multiprocessing.py
test_multiprocessing_spawn.py Add exception classification to torch.multiprocessing.spawn (#45174) 2020-10-09 12:59:41 -07:00
test_namedtensor.py Fixed median nan propagation and implemented nanmedian (#45847) 2020-10-08 11:20:21 -07:00
test_namedtuple_return_api.py Fixed median nan propagation and implemented nanmedian (#45847) 2020-10-08 11:20:21 -07:00
test_native_functions.py Refactor scalar list APIs to use overloads (#45673) 2020-10-19 09:28:49 -07:00
test_nn.py Support int32 indices and offsets in nn.EmbeddingBag (#46758) 2020-11-03 23:33:50 -08:00
test_numba_integration.py
test_op_aliases.py implement NumPy-like functionality column_stack, row_stack (#46313) 2020-10-29 12:14:39 -07:00
test_openmp.py
test_ops.py Update backward formulas (Re #44444) (#46275) 2020-10-25 19:40:59 -07:00
test_optim.py Replace list(map(...)) constructs by list comprehensions (#46461) 2020-10-19 18:42:49 -07:00
test_overrides.py Revert D24649817: [pytorch][PR] Fix pickling for Tensor subclasses. 2020-11-05 10:25:48 -08:00
test_package.py Fix version comparisons for Python 3.6, 3.10 and 4 (#32389) 2020-10-21 11:52:50 -07:00
test_profiler.py Source code level attribution in profiler (#43898) 2020-09-30 00:57:35 -07:00
test_pruning_op.py
test_pytree.py Implement _broadcast_to_and_flatten(pytree, spec) (#46288) 2020-10-20 07:52:14 -07:00
test_quantization.py [quant][graphmode][fx][fusion] Add test for fuse_fx (#47085) 2020-10-30 12:25:54 -07:00
test_serialization.py fix test_serialization not working with Windows. (#46120) 2020-10-12 15:18:46 -07:00
test_show_pickle.py
test_sparse.py check sparse sizes (#47148) 2020-11-09 10:33:24 -08:00
test_spectral_ops.py Mark parts of spectral tests as slow (#46509) 2020-10-19 10:11:46 -07:00
test_static_runtime.py [pt][static_runtime] Memory model (#46896) 2020-11-03 23:47:59 -08:00
test_tensor_creation_ops.py Implement Tensor.new_empty_strided(sizes, strides, *, dtype, device, requires_grad) (#47225) 2020-11-09 08:31:01 -08:00
test_tensorboard.py
test_tensorexpr.py [NNC] Fix lowering of aten::remainder (#47611) 2020-11-09 21:45:42 -08:00
test_throughput_benchmark.py
test_torch.py Fix type promotion for trace on CPU. (#47305) 2020-11-10 07:46:03 -08:00
test_type_hints.py
test_type_info.py
test_type_promotion.py [numpy] torch.cos, torch.tan : promote integer inputs to float (#46706) 2020-10-28 22:02:52 -07:00
test_unary_ufuncs.py [numpy] torch.cos, torch.tan : promote integer inputs to float (#46706) 2020-10-28 22:02:52 -07:00
test_utils.py More Timer refinement (#46023) 2020-10-15 16:32:53 -07:00
test_vmap.py Batched gradient support for view+inplace operations (#47227) 2020-11-10 07:38:02 -08:00
test_vulkan.py
test_xnnpack_integration.py Mark top 3 slowest tests as slow (#46068) 2020-10-08 21:10:03 -07:00