[TensorExpr] Use couldMoveBefore instead of couldMoveAfter checks in the fuser pass, add CPP tests. (#38592)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38592
I'm not sure that using couldMoveAfter was incorrect, but using
couldMoveBefore is more consistent with other subgraph-extraction
passes (old fuser, create autodiff graphs, etc.), so it would make it
easier to unify their implementations after this change.
Test Plan: Imported from OSS
Reviewed By: suo
Differential Revision: D21607856
Pulled By: ZolotukhinM
fbshipit-source-id: 970583af7859889d48aacf620ae028258e37a75f
Author
Mikhail Zolotukhin