Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relax] Fix the parser to avoid treating a list as an integer #17497

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions python/tvm/script/parser/relax/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ def Tensor(
vdevice: Optional[str] = None,
ndim: int = -1,
) -> TensorProxy:
if shape is not None and isinstance(shape, int):
shape = [shape,]
# scalar tensor case
if shape is not None and not isinstance(shape, Var) and len(shape) == 0:
shape = []
Expand Down
Loading