pytorch/test
albanD cd4aa9c95c Fix inplace check logic to be triggered when written to Tensor does not require gradients (#46296)
Summary:
Fix https://github.com/pytorch/pytorch/issues/46242

This ensures that the `check_inplace()` run the proper checks even if the Tensor that is being modified inplace does not requires gradient. As the Tensor written into it might require gradient and will make this inplace modification actually differentiable.
This contains:
- Codegen changes to tell `check_inplace()` if the inplace will be differentiable
- Changes in `handle_view_on_rebase` to work properly even when called for an input that does not require gradients (which was assumed to be true before)
- Corresponding tests (both warnings and the error raise internal assert errors without this fix)

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

Reviewed By: ezyang

Differential Revision: D24903770

Pulled By: albanD

fbshipit-source-id: 74e65dad3d2e3b9f762cbb7b39f92f19d9a0b094
2020-11-16 08:06:06 -08:00
..
backward_compatibility Unbreak backward compatibility tests (#47726) 2020-11-10 21:37:39 -08:00
benchmark_utils More Timer refinement (#46023) 2020-10-15 16:32:53 -07:00
bottleneck_test
cpp Revert D24698027: Fix auto exponent issue for torch.pow 2020-11-15 03:58:44 -08:00
cpp_api_parity Support tuple inputs in NN Module test (#44853) 2020-09-28 22:05:05 -07:00
cpp_extensions Make empty c10-full (#46092) 2020-11-12 17:08:21 -08: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 [resubmit] Providing more information while crashing process in async error handling (#47246) 2020-11-13 20:11:06 -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 Back out "[JIT] Fix function schema subtype checking" 2020-11-13 20:33:54 -08:00
mobile PyTorch NNAPI integration prototype (#46780) 2020-11-05 21:31:01 -08:00
namespace_b torch.package - a way to package models and code (#45015) 2020-09-22 21:21:21 -07:00
onnx [ONNX] Enable onnx shape inference in export by default (#46629) 2020-11-13 15:09:46 -08:00
optim
package_a torch.package - a way to package models and code (#45015) 2020-09-22 21:21:21 -07:00
quantization Revert "[quant] Remove nn.quantized.ReLU module and nn.quantized.functional.relu (#47415)" (#47949) 2020-11-14 08:40:30 -08:00
scripts
test_img
type_hint_tests
HowToWriteTestsUsingFileCheck.md
module_a.py torch.package - a way to package models and code (#45015) 2020-09-22 21:21:21 -07:00
print_test_stats.py add workflow ID to report tags (#46725) 2020-10-23 12:10:54 -07:00
run_test.py Add '--allow-run-as-root' to mpiexec to allow running distributed test inside a container (#43794) 2020-11-13 15:31:06 -08:00
simulate_nccl_errors.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_autograd.py Fix inplace check logic to be triggered when written to Tensor does not require gradients (#46296) 2020-11-16 08:06:06 -08:00
test_bundled_images.py
test_bundled_inputs.py
test_complex.py
test_cpp_api_parity.py Always use NewModuleTest instead of ModuleTest. (#44745) 2020-09-17 07:36:39 -07:00
test_cpp_extensions_aot.py Fix exception chaining in test/ (#44193) 2020-09-14 14:20:16 -07:00
test_cpp_extensions_jit.py [JIT] Disable broken tests (#43750) 2020-08-27 18:12:57 -07:00
test_cuda_primary_ctx.py
test_cuda.py [ROCm] enable stream priorities (#47136) 2020-11-02 11:25:44 -08:00
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 Rename test_distributed to test_distributed_fork (#42932) 2020-09-08 23:13:37 -07:00
test_dispatch.py [WIP] Move catchAll to Math (#45939) 2020-10-16 16:17:16 -07:00
test_expecttest.py
test_foreach.py Revert D24737050: [WIP] Adding bunch of unary foreach APIs 2020-11-10 09:41:41 -08:00
test_function_schema.py Stricter backward compatibility check (#45773) 2020-10-06 01:28:48 -07:00
test_functional_autograd_benchmark.py Reland of benchmark code (#43428) 2020-08-24 13:27:26 -07:00
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_experimental.py change file name to snake style (#47914) 2020-11-14 01:29:25 -08:00
test_fx.py change file name to snake style (#47914) 2020-11-14 01:29:25 -08:00
test_indexing.py
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_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][te] Don't start TE fusion groups with an unknown-typed result (#47884) 2020-11-13 10:52:53 -08:00
test_jit_fuser.py Adjust TF32 tests (#44240) 2020-09-24 10:25:58 -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_jit.py [JIT] Dont use specialized tensor type (#46130) 2020-11-13 18:34:40 -08:00
test_kernel_launch_checks.py Ensure kernel launches are checked (#46474) 2020-10-28 09:27:48 -07:00
test_linalg.py Added linalg.cholesky (#46083) 2020-11-13 16:50:40 -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 Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_mobile_optimizer.py Make add_relu an internal function (#46676) 2020-10-22 18:08:15 -07:00
test_multiprocessing_spawn.py Add exception classification to torch.multiprocessing.spawn (#45174) 2020-10-09 12:59:41 -07:00
test_multiprocessing.py
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 Revert D24941350: [pytorch][PR] Reopen PR for 0 dim batch size for AvgPool2d. 2020-11-13 22:33:37 -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 Fix classmethod override argument passing. (#47114) 2020-11-11 09: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 Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
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 Add LeakyReLU operator to static runtime (#47798) 2020-11-13 22:05:52 -08:00
test_tensor_creation_ops.py Spurious numpy writable warning (#47271) 2020-11-12 00:14:56 -08:00
test_tensorboard.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_tensorexpr.py [NNC] Fix lowering of aten::pow (#47795) 2020-11-12 12:33:07 -08:00
test_throughput_benchmark.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_torch.py Batched matmul dtypes (#47873) 2020-11-14 22:45:48 -08:00
test_type_hints.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
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 [complex] torch.sqrt: fix edge values (#47424) 2020-11-10 14:51:04 -08:00
test_utils.py Revert D24891767: rename torch.Assert to torch._assert 2020-11-13 08:35:05 -08:00
test_vmap.py Batching rule for torch.squeeze(tensor) (#47632) 2020-11-11 14:08:39 -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