pytorch/test
Antonio Kim 6b59d9b566 Fix registration hooks (#87369)
There is a bug in the implementation of the registration hooks introduced in https://github.com/pytorch/pytorch/pull/86148 whereby if the hook returns a tensor, then the short circuiting logic:
```
value = hook(self, name, value) or value
```
Raises an exception
```
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
```
Fixing the logic so that it only checks to see if the value is `None` before overriding

Fixes #85837

CC: @albanD @jbschlosser
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87369
Approved by: https://github.com/albanD
2022-10-21 05:12:25 +00:00
..
ao/sparsity Use Variable Size Indices in Sparse Qlinear Code (#85247) 2022-10-13 05:50:04 +00:00
autograd
backends/xeon A Launch script with Best Recipe of Deep Learning on Intel Xeon CPU (#63932) 2022-07-29 12:57:22 +00:00
benchmark_utils
bottleneck_test
cpp Back out "Revert D40198461: [pytorch][PR] Backport currently dont work with some models if:" (#87124) 2022-10-20 23:02:10 +00:00
cpp_api_parity
cpp_extensions Refactor distribuetd to use absolute header path (#85780) 2022-09-30 05:13:50 +00:00
custom_backend
custom_operator set data permits requires_grad=True on integer tensor 2022-06-01 15:56:32 +00:00
distributed Improve the performance of validate_non_overlapping_shards_metadata (#85639) 2022-10-20 23:51:48 +00:00
distributions Revert "Add mkl implementation for exponential on CPU (#69967)" 2022-09-08 20:30:23 +00:00
dynamo [dynamo] Add support for invoking nn sequential (#87156) 2022-10-20 18:14:40 +00:00
error_messages
expect [FX] Add one option to maintain the FX graph execution order after splitting_module (#85188) 2022-09-23 23:21:54 +00:00
forward_backward_compatibility 🦊 [AI Accelerators] Consolidate native_layer_norm for nested tensor (#86295) 2022-10-06 13:10:25 +00:00
functorch [functorch] Fix torch.cat batching rule (#86932) 2022-10-20 18:01:31 +00:00
fx Introduce a match filter for SubgraphRewriter (#86430) 2022-10-07 05:09:40 +00:00
inductor [Inductor] Convert 0d CPU tensor to scalar during triton codegen (#87329) 2022-10-21 01:24:00 +00:00
jit [xnnpack][lite-int] preprocess (#86980) 2022-10-14 22:07:12 +00:00
jit_hooks
lazy Revert "Revert "Symintifying slice ops (#85196)"" (#85746) 2022-09-28 04:37:35 +00:00
mobile [quant][ao_migration] torch.nn.quantized.modulestorch.ao.nn.quantized.modules (#78713) 2022-08-25 16:50:33 +00:00
nn add _freeze for embedding op (#86769) 2022-10-13 20:12:52 +00:00
onnx [ONNX] Ignore print(Tensor) during tracing (#86223) 2022-10-17 19:45:33 +00:00
package Allow torch._C to be recognized a module in torch.package (#80917) 2022-07-12 18:10:22 +00:00
profiler [Profiler][Trivial] Small style and safety fixes (#86752) 2022-10-20 17:34:16 +00:00
quantization [Quant] Add get_symmetric_qnnpack_qconfig_mapping (#87002) 2022-10-20 02:33:15 +00:00
scripts
test_img
typing
allowlist_for_publicAPI.json [ao] fixing public v private for fx.backend_config_utils.py (#86037) 2022-10-13 16:04:42 +00:00
conftest.py [ci] print rerun stacktraces for pytest (#86831) 2022-10-14 17:31:31 +00:00
create_dummy_torchscript_model.py
delete.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py
mkl_verbose.py [RFC] enable oneMKL&oneDNN on-demands verbose functinality (#63212) 2022-07-27 23:29:35 +00:00
mkldnn_verbose.py [RFC] enable oneMKL&oneDNN on-demands verbose functinality (#63212) 2022-07-27 23:29:35 +00:00
run_doctests.sh Integrate xdoctest - Rebased (#82797) 2022-08-12 02:08:01 +00:00
run_test.py Reenable aot tests on windows for cuda 11.7 and up (#87193) 2022-10-19 17:09:37 +00:00
simulate_nccl_errors.py
test_ao_sparsity.py [AO] Cubic sparsity level scheduler (#85232) 2022-10-04 22:44:15 +00:00
test_autocast.py
test_autograd.py Update saved variable hooks to no longer trigger on wrapped numbers (#87316) 2022-10-20 03:01:11 +00:00
test_binary_ufuncs.py Add bfloat16 support for lerp on CPU (#84327) 2022-09-29 01:16:16 +00:00
test_bundled_images.py
test_bundled_inputs.py
test_comparison_utils.py Add aten _assert_tensor_metadata op (#84617) 2022-09-19 20:48:09 +00:00
test_complex.py
test_cpp_api_parity.py Make M1 tests green (#82213) 2022-08-05 16:12:08 +00:00
test_cpp_extensions_aot.py Allow relocatable device code linking in pytorch CUDA extensions (#78225) 2022-06-02 21:35:56 +00:00
test_cpp_extensions_jit.py Reenable TestCppExtensionJIT on M1 (#84552) 2022-09-06 17:49:29 +00:00
test_cpp_extensions_open_device_registration.py Make M1 tests green (#82213) 2022-08-05 16:12:08 +00:00
test_cuda_nvml_based_avail.py Extend torch.cuda.is_available() to attempt an NVML-based CUDA availability assessment when explicitly requested by the user (#85951) 2022-10-12 18:37:50 +00:00
test_cuda_primary_ctx.py
test_cuda_sanitizer.py Rework printing tensor aliases in CSAN error message (#85008) 2022-09-21 13:41:52 +00:00
test_cuda_trace.py Add synchronize hooks (#84427) 2022-09-09 13:56:59 +00:00
test_cuda.py [allocator] disable tests that don't work for cudaMallocAsyncAllocator (#87250) 2022-10-19 18:29:35 +00:00
test_dataloader.py [DataPipe] Reset Shuffler's iterator when NotStarted (#83535) 2022-08-25 19:45:41 +00:00
test_datapipe.py [DataPipe] Fix MapDataPipe spawn lambda test (#85668) 2022-09-27 19:58:15 +00:00
test_decomp.py OpInfo: Sample input cleanup (4/n) (#86324) 2022-10-19 21:25:45 +00:00
test_deploy.py
test_determination.py
test_dispatch.py Remove unnecessary skips in test_dispatch.py (#85557) 2022-09-26 15:35:47 +00:00
test_dlpack.py Normalize DLPack stride to 1 where shape < 2 (#83158) 2022-08-23 15:03:29 +00:00
test_dynamic_shapes.py Unified symbolic shape variables between AOTAutograd and Inductor (#86659) 2022-10-14 00:24:43 +00:00
test_dynamic_shapes.py.bak Unified symbolic shape variables between AOTAutograd and Inductor (#86659) 2022-10-14 00:24:43 +00:00
test_expanded_weights.py Tweak test tolerances to be compatible with A10G (#86538) 2022-10-11 23:31:48 +00:00
test_fake_tensor.py Enable aten-aten decomps (#85921) 2022-10-08 05:12:42 +00:00
test_foreach.py Test Dynamo CI w Fake Tensors (#84282) 2022-09-01 00:15:05 +00:00
test_function_schema.py [frontend] Print real type for Argument (#85103) 2022-09-15 22:16:32 +00:00
test_functional_autograd_benchmark.py
test_functional_optim.py [CI] Build MacOS M1 binaries without distributed support (#86451) 2022-10-10 17:42:13 +00:00
test_functionalization.py Refactored proxytensor to clean up separate branches (#84325) 2022-08-31 09:37:55 +00:00
test_futures.py [torch.futures] Fix nullptr deref (#85304) 2022-09-20 01:49:04 +00:00
test_fx_backends.py [ROCm] enable nvfuser (#82498) 2022-08-30 21:50:39 +00:00
test_fx_experimental.py [fx] Make NormalizeArgs preserve node type (#85637) 2022-09-26 21:30:16 +00:00
test_fx_passes.py Patching getitem in partitioner (#86713) 2022-10-12 07:50:46 +00:00
test_fx_reinplace_pass.py [CMake] Add functorch target (#83464) 2022-09-14 00:05:33 +00:00
test_fx.py Implement col2im decomposition and fix im2col and add a few preconditions (#85541) 2022-09-30 09:31:53 +00:00
test_hub.py
test_import_stats.py Revert "Revert "[ci] remove remaining RDS dependency"" 2022-06-15 10:04:13 -07:00
test_indexing.py add nominal support for int32 indices in index/index_put ops (#86309) 2022-10-05 23:59:16 +00:00
test_itt.py Fix ITT unit-tests if PyTorch is compiled with USE_ITT=OFF (#86199) 2022-10-04 21:57:05 +00:00
test_jit_autocast.py [JIT] Retry - Support scripting torch.is_autocast_enabled() (#82394) 2022-08-10 18:26:17 +00:00
test_jit_cuda_fuser.py [NVFuser] Upstream push 0907 (#84626) 2022-09-23 20:29:48 +00:00
test_jit_disabled.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py symintify rand and randint functions and meta suport for randint (#86358) 2022-10-10 17:07:11 +00:00
test_jit_fuser.py
test_jit_legacy.py Remove mentions of non-existing test_jit_py3 (#78977) 2022-06-07 02:28:45 +00:00
test_jit_llga_fuser.py Add BFloat16 dtype support for oneDNN Graph JIT fuser (#85591) 2022-10-13 20:36:59 +00:00
test_jit_profiling.py Remove mentions of non-existing test_jit_py3 (#78977) 2022-06-07 02:28:45 +00:00
test_jit_simple.py Remove mentions of non-existing test_jit_py3 (#78977) 2022-06-07 02:28:45 +00:00
test_jit_string.py
test_jit.py Support unpacking python dictionary in torch.jit.trace() (#81623) 2022-10-15 05:33:09 +00:00
test_jiterator.py [ROCm] enable jiterator (#77982) 2022-08-15 16:04:09 +00:00
test_kernel_launch_checks.py
test_license.py
test_linalg.py Add test case for matrix multiply-add with large inputs (#85550) 2022-10-11 17:52:21 +00:00
test_logging.py
test_masked.py [maskedtensor] port torch/_masked into torch/masked (#85515) 2022-09-26 23:41:13 +00:00
test_maskedtensor.py [maskedtensor] use masked_softmax for forward/backward instead of regular softmax (#85845) 2022-10-04 00:29:19 +00:00
test_matmul_cuda.py Add test case for matrix multiply-add with large inputs (#85550) 2022-10-11 17:52:21 +00:00
test_meta.py Add meta inplace testing (#87291) 2022-10-20 14:20:16 +00:00
test_metal.py
test_mkl_verbose.py [RFC] enable oneMKL&oneDNN on-demands verbose functinality (#63212) 2022-07-27 23:29:35 +00:00
test_mkldnn_fusion.py torchdynamo: add linear pointwise(binary) fusion kernel (#86583) 2022-10-15 01:57:42 +00:00
test_mkldnn_verbose.py [RFC] enable oneMKL&oneDNN on-demands verbose functinality (#63212) 2022-07-27 23:29:35 +00:00
test_mkldnn.py test mkldnn conv2d channels last when weight is nchw format (#77348) 2022-09-09 07:28:04 +00:00
test_mobile_optimizer.py
test_model_dump.py Fix failing test_model_dump due to empty file (#84744) 2022-09-12 20:59:19 +00:00
test_module_init.py [quant][ao_migration] torch.nn.qattorch.ao.nn.qat (#78716) 2022-08-25 16:50:38 +00:00
test_modules.py Tweak test tolerances to be compatible with A10G (#86538) 2022-10-11 23:31:48 +00:00
test_monitor.py
test_mps.py [primTorch] Add refs for softmax, softmin, log_softmax (#84956) 2022-10-20 12:29:04 +00:00
test_multiprocessing_spawn.py
test_multiprocessing.py [ROCm] Enable test_multiprocessing tests (#82356) 2022-08-24 20:49:20 +00:00
test_namedtensor.py Revert "Update amax/amin/norm/count_nonzero signatures with int[*]? dim (#83300)" 2022-09-28 17:04:53 +00:00
test_namedtuple_return_api.py Remove deprecated torch.lstsq (#70980) 2022-09-23 00:16:55 +00:00
test_native_functions.py
test_native_mha.py Add python nested_tensor and as_nested_tensor constructors in torch.nested (#85593) 2022-09-28 20:15:02 +00:00
test_nestedtensor.py Add support for .to() for NestedTensor backends (#87146) 2022-10-20 03:46:50 +00:00
test_nn.py Fix registration hooks (#87369) 2022-10-21 05:12:25 +00:00
test_nnapi.py [quant][ao_migration] torch.nn.quantized.modulestorch.ao.nn.quantized.modules (#78713) 2022-08-25 16:50:33 +00:00
test_numba_integration.py
test_numpy_interop.py ENH: Add a force argument to numpy() (#78564) 2022-06-06 14:14:17 +00:00
test_nvfuser_frontend.py Create Cache for Fusion Reuse in NVFuser in Python Frontend for Primtorch (#85045) 2022-09-17 10:52:54 +00:00
test_openmp.py
test_ops_gradients.py Change legacy wrap_dim to work with symint == (#86842) 2022-10-13 15:10:46 +00:00
test_ops_jit.py OpInfo for Slice (#85554) 2022-09-23 22:01:32 +00:00
test_ops.py [primTorch] Add refs for softmax, softmin, log_softmax (#84956) 2022-10-20 12:29:04 +00:00
test_optim.py Make AdamW, NAdam & RAdam differentiable (#86183) 2022-10-17 04:32:08 +00:00
test_overrides.py [Modes] fix handle_torch_funcion logic (#85707) 2022-09-27 18:35:51 +00:00
test_package.py
test_per_overload_api.py Add OpOverload.decompose API (#83075) 2022-08-09 18:53:19 +00:00
test_prims.py Workarounds for cudnn_batch_norm with TorchRefsNvfuserCapabilityMode (#86796) 2022-10-17 18:46:28 +00:00
test_proxy_tensor.py Add inplace function testing to test_proxy_tensor (#87324) 2022-10-20 14:20:19 +00:00
test_pruning_op.py
test_public_bindings.py Manual changes for moving dynamo to core (#86621) 2022-10-11 23:01:21 +00:00
test_python_dispatch.py Consistent compute numel/contiguous strategy with SymInts (#85858) 2022-09-30 21:26:34 +00:00
test_pytree.py Make nested TreeSpec printing nicer (#46538) (#86546) 2022-10-18 16:50:39 +00:00
test_quantization.py PNP: early FX numeric suite tool to quantize each layer N times (#80521) 2022-10-06 02:30:45 +00:00
test_reductions.py Skip chalf.mean in test_reductions_large_half_tensors (#86747) 2022-10-11 23:27:30 +00:00
test_scatter_gather_ops.py Add deterministic impl of scatter_add CUDA for all input sizes (#79466) 2022-09-07 03:12:49 +00:00
test_schema_check.py [Modes] remove enable and rewrite mode stack (squashed) (#84774) 2022-09-27 01:04:35 +00:00
test_segment_reductions.py reland Add offsets-based reduction to segment_reduce (CPU, CUDA) 2022-06-17 15:49:31 +00:00
test_serialization.py Add weights_only option to torch.load (#86812) 2022-10-21 01:09:50 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Enable sparse_dim() and dense_dim() methods for Strided tensors (#86203) 2022-10-06 18:39:22 +00:00
test_show_pickle.py
test_sort_and_select.py Re-enable fixed dynamo tests (#84969) 2022-09-16 15:36:52 +00:00
test_sparse_csr.py Upcast to fp32 in test_addmm_block ref_half_bfloat16 (#86682) 2022-10-11 16:39:57 +00:00
test_sparse.py Support sum on a sparse COO tensor. (#86300) 2022-10-06 18:39:28 +00:00
test_spectral_ops.py istft: require complex input (#86628) 2022-10-18 12:03:55 +00:00
test_stateless.py add deprecation warning to nn stateless functional_call (#87367) 2022-10-20 20:16:49 +00:00
test_static_runtime.py [Static Runtime] test case for staticRuntime::runAsync() API (#80407) 2022-07-05 23:40:53 +00:00
test_subclass.py [torchdynamo hash update] update the pinned torchdynamo hash (#85225) 2022-09-26 20:07:13 +00:00
test_tensor_creation_ops.py [reland] [numpy] add torch.concatenate, alias of torch.cat (#85073) 2022-09-15 19:34:44 +00:00
test_tensorboard.py [tensorboard] update assertion error for scalar() and fix docs (#76859) 2022-06-16 05:24:20 +00:00
test_tensorexpr_pybind.py
test_tensorexpr.py Use high precision accmulate buffer for bf16 accmulation (#84402) 2022-09-27 04:40:42 +00:00
test_testing.py [CI] Build MacOS M1 binaries without distributed support (#86451) 2022-10-10 17:42:13 +00:00
test_throughput_benchmark.py
test_torch.py Add Warning class and refactor C++ warnings to use it (#84101) 2022-10-18 20:02:42 +00:00
test_transformers.py Assert if padding mask type is unexpected (#86353) (#87106) 2022-10-20 16:01:54 +00:00
test_type_hints.py
test_type_info.py
test_type_promotion.py Land "Make ceil,floor,round,trunc handle integers" (#85144) 2022-09-21 17:23:47 +00:00
test_typing.py
test_unary_ufuncs.py Adding multigammaln ref and fix arange (#85153) 2022-09-20 17:52:56 +00:00
test_utils.py Update saved variable hooks to no longer trigger on wrapped numbers (#87316) 2022-10-20 03:01:11 +00:00
test_view_ops.py Setup for running PyTorch tests with TorchDynamo and skips for known failing tests (#80106) 2022-07-07 18:57:33 +00:00
test_vmap.py
test_vulkan.py
test_xnnpack_integration.py