pytorch
9541053c - [dynamo] support FakeTensor for SYM_INT/SYM_INT_LIST/INT_LIST param in python-to-cpp argument parsing (#103448)

Commit
1 year ago
[dynamo] support FakeTensor for SYM_INT/SYM_INT_LIST/INT_LIST param in python-to-cpp argument parsing (#103448) before the PR, when compiling a function with signature symint/symintlist/intlist, we have runtime error like ```argument 'shifts' must be tuple of ints, not FakeTensor```. see newly added unit test in test/dynamo/test_misc.py for repro after the PR, for FakeTensor with empty size and numel()=1, we will try to convert it into symint/symintlist. we will likely see expected exception ```torch._subclasses.fake_tensor.DataDependentOutputException / aten._local_scalar_dense.default``` during conversion reference PR: * we handle FakeTensor for symintlist as 1st varags: https://github.com/pytorch/pytorch/pull/97508 * we handle FakeTensor for intlist in a similar way: https://github.com/pytorch/pytorch/pull/85759/files * call local_scalar_dense on a FakeTensor: https://github.com/pytorch/pytorch/commit/f7365eca901b0ed5c5edc0d2ae92834b7b75c0d2 Pull Request resolved: https://github.com/pytorch/pytorch/pull/103448 Approved by: https://github.com/yanboliang
Author
Committer
Parents
Loading