You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Since updating taichi to 1.7, I can't use type hinting for return tuple using a @ti.func, it was working under 1.6. Same behaviour with @ti.pyfunc. It works with @ti.real_func though.
Is it the expected behaviour?
$ python .\test-new-dev.py
[Taichi] version 1.7.0, llvm 15.0.1, commit 2fd24490, win, python 3.11.7
[Taichi] Starting on arch=x64
Traceback (most recent call last):
File "C:\Users\kevin\dev\taichi\test-new-dev.py", line 19, in <module>
print(kernel())
^^^^^^^^
File "C:\Users\kevin\miniforge3\envs\taichi\Lib\site-packages\taichi\lang\kernel_impl.py", line 1107, in wrapped
raise type(e)("\n" + str(e)) from None
taichi.lang.exception.TaichiCompilationError:
File "C:\Users\kevin\dev\taichi\test-new-dev.py", line 16, in kernel:
return foo()
^^^^^
File "C:\Users\kevin\dev\taichi\test-new-dev.py", line 11, in foo:
return a, b
^^^^^^^^^^^
Traceback (most recent call last):
File "C:\Users\kevin\miniforge3\envs\taichi\Lib\site-packages\taichi\lang\ast\ast_transformer_utils.py", line 27, in __call__
return method(ctx, node)
^^^^^^^^^^^^^^^^^
File "C:\Users\kevin\miniforge3\envs\taichi\Lib\site-packages\taichi\lang\ast\ast_transformer.py", line 928, in build_Return
ctx.return_data[i] = ti_ops.cast(ctx.return_data[i], return_type)
~~~~~~~~~~~~~~~^^^
TypeError: 'tuple' object does not support item assignment
...
The text was updated successfully, but these errors were encountered:
I don't think we supports the standard square bracket type hints...
We do support them in v1.7.0. Maybe we forgot to add support for the ti.func. However the type hint of ti.func isn't mandatory. You can remove the return type hint for now.
Hello
Describe the bug
Since updating taichi to 1.7, I can't use type hinting for return tuple using a
@ti.func
, it was working under 1.6. Same behaviour with@ti.pyfunc
. It works with@ti.real_func
though.Is it the expected behaviour?
To Reproduce
Log/Screenshots
The text was updated successfully, but these errors were encountered: