[TensorExpr] Move 2 graph passes from kernel.cpp to graph_opt.cpp (#64828)
authorMikhail Zolotukhin <mvz@fb.com>
Sat, 11 Sep 2021 17:21:42 +0000 (10:21 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 11 Sep 2021 17:23:15 +0000 (10:23 -0700)
commit82ac3f108d06a9222971e3f8ed2d1bdda2cb42ad
treefb3fbcf6c0a67e89aace6f73cca6d4cfaec0a162
parentff65f637df754d6239b96983d5dbf2f77d3b8e60
[TensorExpr] Move 2 graph passes from kernel.cpp to graph_opt.cpp (#64828)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64828

Also, make `removeUnusedSelfArgument` more consistent with other passes
by mutating the graph in-place rather than returning a copy.

Test Plan: Imported from OSS

Reviewed By: ngimel

Differential Revision: D30870776

Pulled By: ZolotukhinM

fbshipit-source-id: 4873f01b013921143a5aa43746d655a2d8d620c9
test/test_tensorexpr_pybind.py
torch/csrc/jit/tensorexpr/graph_opt.cpp
torch/csrc/jit/tensorexpr/graph_opt.h
torch/csrc/jit/tensorexpr/kernel.cpp
torch/csrc/jit/tensorexpr/kernel.h
torch/csrc/jit/tensorexpr/tensorexpr_init.cpp