-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Type hint error when passing ti.template() var to ti.func as a list index #8449
Comments
This is not a bug. If you want fields with multiple dimensions you can declare them as so e.g. shape=(num_layers, 100). Python arrays in taichi must be indexed statically (i.e. with ti.template and ti.static which makes the indexing compile time) |
The fields are just for reproducing. The key point is the type hint ti.template() of the ti.func is mandatory for this case... |
Still, Python arrays must be explicitly statically indexed ... |
Describe the bug
When passing a ti.template() variable as a list index into the ti.func function, it have to use type hint to work
To Reproduce
Log/Screenshots
Please post the full log of the program (instead of just a few lines around the error message, unless the log is > 1000 lines). This will help us diagnose what's happening. For example:
Additional comments
I'm not sure if this is a bug or not. it seems like ti.func should work without a type hint
The text was updated successfully, but these errors were encountered: