We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I am getting invalid type annotation no matter how I write my kernel.
To Reproduce I got the example in the FAQ section (https://docs.taichi-lang.org/docs/faq), and it gives me:
taichi.lang.exception.TaichiSyntaxError: Invalid type annotation (argument 0) of Taichi kernel: ti.types.ndarray()
I even changed from python 3.10 to 3.9 and the exactly same exception persists.
import taichi as ti import numpy as np ti.init(arch=ti.cpu) x = ti.field(ti.i32, shape=3) array = np.array([10, 20, 30]) @ti.kernel def test(arr: ti.types.ndarray()): for i in range(3): x[i] = arr[i] test(array)
The text was updated successfully, but these errors were encountered:
Lucky! While testing again, I by mistake, removed the first line of the code:
from __future__ import annotations
it now works! looks like there is a conflict in how taichi interprets type hints with annotations enabled.
Sorry, something went wrong.
feisuzhu
No branches or pull requests
Describe the bug
I am getting invalid type annotation no matter how I write my kernel.
To Reproduce
I got the example in the FAQ section (https://docs.taichi-lang.org/docs/faq), and it gives me:
taichi.lang.exception.TaichiSyntaxError: Invalid type annotation (argument 0) of Taichi kernel: ti.types.ndarray()
I even changed from python 3.10 to 3.9 and the exactly same exception persists.
The text was updated successfully, but these errors were encountered: