Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63536
Enable a pass that transforms sequences like this:
```
li = []
li.append(1)
li.append(2)
```
into this:
```
li = [1, 2]
```
Initially I implemented this pass myself (
D30387213), but I discovered that there is an existing pass that does the same thing.
Reviewed By: hlu1
Differential Revision:
D30412970
fbshipit-source-id:
0810ef03480878d5039bd800a40f5fd31c2652ec
#include <torch/csrc/jit/passes/clear_profiling.h>
#include <torch/csrc/jit/passes/inliner.h>
#include <torch/csrc/jit/passes/lower_tuples.h>
+#include <torch/csrc/jit/passes/remove_mutation.h>
#include <torch/csrc/jit/runtime/graph_executor_impl.h>
#include <stack>
auto applyOptimizations = [](std::shared_ptr<Graph>& subgraph) {
runOptimization(
subgraph, /* unroll? */ false, /* const_prop_user_classes? */ false);
+ RemoveListMutation(subgraph);
LowerSimpleTuples(subgraph);
};