mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Summary: This PR adds a preprocessing step in Conv2dBatchNorm folding. It traverses the module to check if the bias of Conv2d module is set to None. If it is, it assume that this a traced module and insert Optional[Tensor] type bias. Furthermore it insert getAttr for bias in the forward graph and fixes _convolution op to take values from getAttr. It also fixes parametere extraction from BN module which may not have weight and bias attributes if affine was set to False. In scripted mode such a BN module will get weight and bias attributes set to None. For the case of eps it gets const propagated in tracing. This is also fixed. Few tests cases are added. Pull Request resolved: https://github.com/pytorch/pytorch/pull/34932 Test Plan: python test/test_jit.py TestJit.test_foldbn_trivial python test/test_jit.py TestJit.test_foldbn_trivial_nobias python test/test_jit.py TestJit.test_foldbn_in_submodule python test/test_jit.py TestJit.test_foldbn_shared_classtype python test/test_jit.py TestJit.test_foldbn_complex_cases python test/test_jit.py TestJit.test_nofoldbn_complex_cases Differential Revision: D20536478 Pulled By: kimishpatel fbshipit-source-id: 4e842976a380d0575a71001bb4481390c08c259e |
||
|---|---|---|
| .. | ||
| backward_compatibility | ||
| bottleneck_test | ||
| cpp | ||
| cpp_api_parity | ||
| cpp_extensions | ||
| custom_operator | ||
| distributed | ||
| error_messages | ||
| expect | ||
| jit | ||
| mobile | ||
| onnx | ||
| optim | ||
| scripts | ||
| type_hint_tests | ||
| HowToWriteTestsUsingFileCheck.md | ||
| run_test.py | ||
| simulate_nccl_errors.py | ||
| te_utils.py | ||
| test_autograd.py | ||
| test_complex.py | ||
| test_cpp_api_parity.py | ||
| test_cpp_extensions_aot.py | ||
| test_cpp_extensions_jit.py | ||
| test_cuda.py | ||
| test_cuda_primary_ctx.py | ||
| test_dataloader.py | ||
| test_determination.py | ||
| test_distributions.py | ||
| test_docs_coverage.py | ||
| test_expecttest.py | ||
| test_fake_quant.py | ||
| test_function_schema.py | ||
| test_indexing.py | ||
| test_jit.py | ||
| test_jit_disabled.py | ||
| test_jit_fuser.py | ||
| test_jit_fuser_legacy.py | ||
| test_jit_fuser_te.py | ||
| test_jit_legacy.py | ||
| test_jit_py3.py | ||
| test_jit_simple.py | ||
| test_jit_string.py | ||
| test_logging.py | ||
| test_mkldnn.py | ||
| test_multiprocessing.py | ||
| test_multiprocessing_spawn.py | ||
| test_namedtensor.py | ||
| test_namedtuple_return_api.py | ||
| test_nn.py | ||
| test_numba_integration.py | ||
| test_optim.py | ||
| test_overrides.py | ||
| test_qat.py | ||
| test_quantization.py | ||
| test_quantized.py | ||
| test_quantized_models.py | ||
| test_quantized_nn_mods.py | ||
| test_quantized_tensor.py | ||
| test_serialization.py | ||
| test_sparse.py | ||
| test_tensorboard.py | ||
| test_tensorexpr.py | ||
| test_throughput_benchmark.py | ||
| test_torch.py | ||
| test_type_hints.py | ||
| test_type_info.py | ||
| test_type_promotion.py | ||
| test_utils.py | ||
| test_xnnpack_integration.py | ||