pytorch/test/cpp
David Berard e86d8323cb [JIT] Add special cases for batch_norm, instance_norm in alias_analysis (#66554)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66554

In native_functions.yaml, the schemas for batch_norm and instance_norm
are incorrect: the inputs `running_mean` and `running_var` are mutated,
but are not marked as such in the function schema. Since `(a!)?`
annotations are currently not working (see #65760), this instead adds a
special case to `alias_anaysis.cpp`. If the value of `training` or
`use_input_stats` is known to be `false`, then `alias_analysis` will
mark the input as _not_ being written to.

Test Plan:
Removed the `skip` annotation on the following test, and added a special
exception in `check_alias_annotations`:
```
python test/test_ops.py -k test_variant_consistency_jit_nn_functional_batch_norm
```

Also:
```
./build/bin/test_jit --gtest_filter="*BatchAndInstanceNormFixture*"
```

Imported from OSS

Reviewed By: eellison

Differential Revision: D31612339

fbshipit-source-id: 12ca61b782b9e41e06883ba080a276209dc435bb
2021-10-20 10:22:10 -07:00
..
api use irange for loops 5 (#66744) 2021-10-18 21:59:50 -07:00
c10d use irange for loops 5 (#66744) 2021-10-18 21:59:50 -07:00
common Trim libshm deps, move tempfile.h to c10 (#17019) 2019-02-13 19:38:35 -08:00
dist_autograd Fix distributed autograd gradients synchronization (#57792) 2021-05-09 17:32:59 -07:00
jit [JIT] Add special cases for batch_norm, instance_norm in alias_analysis (#66554) 2021-10-20 10:22:10 -07:00
lazy Add lazy Node base and associated infra (#66601) 2021-10-18 19:09:42 -07:00
lite_interpreter_runtime Back out "Revert D30710710: [Pytorch Edge] Support profiling kineto events from external source" (#66421) 2021-10-12 10:55:29 -07:00
rpc use irange for loops 5 (#66744) 2021-10-18 21:59:50 -07:00
tensorexpr use irange for loops 5 (#66744) 2021-10-18 21:59:50 -07:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00