Propagate symbolic dimensions through idioms like x.view(y.size()) (#61975)
authorElias Ellison <eellison@fb.com>
Tue, 17 Aug 2021 18:21:50 +0000 (11:21 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 17 Aug 2021 18:25:22 +0000 (11:25 -0700)
commit9a607594534f27396c9ea703f7e9c818df662195
tree605b568eb6b506d54c78a4a985359236a9e2fc2c
parent60cadd0bd185d02a08cb4a62c4d14a9da6255dee
Propagate symbolic dimensions through idioms like x.view(y.size()) (#61975)

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

Propagate symbolic dimensions through size calls. We did this by associating SymbolicSizes with integer inputs by looking through their constructors for `x.size(1)` or `x.size()` nodes.

Test Plan: Imported from OSS

Reviewed By: gchanan

Differential Revision: D30196948

Pulled By: eellison

fbshipit-source-id: 377fc1d2f6d396c52dc0e87fa814b15720f1414e
test/jit/test_symbolic_shape_analysis.py
torch/csrc/jit/passes/symbolic_shape_analysis.cpp