-
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
Do not the Kernel arguments support the class 'bool'? #6036
Comments
Thanks for the issue. @strongoier I noticed that the |
|
As a first step towards adding the proper bool type, we're going to add Specifically:
This is only a temporary workaround as we work on a more permanent solution. |
Issue: #577 #6036 ### Brief Summary This PR adds `bool` as an alias to `ti.i32`. Specifically, - `x: bool` is equivalent to `x: i32` - `-> bool` is equivalent to `-> i32` - `bool(x)` is equivalent to `ti.cast(x, i32)`. This is a temporary solution while we work towards a standalone bool type. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…6742) Issue: taichi-dev#577 taichi-dev#6036 ### Brief Summary This PR adds `bool` as an alias to `ti.i32`. Specifically, - `x: bool` is equivalent to `x: i32` - `-> bool` is equivalent to `-> i32` - `bool(x)` is equivalent to `ti.cast(x, i32)`. This is a temporary solution while we work towards a standalone bool type. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
When I set the type-hinted of my Kernel arguments as 'bool', there existed an error:
TaichiSyntaxError: Invalid type annotation (argument 0) of Taichi kernel: <class 'bool'>
So, do not the Kernel arguments support the class 'bool'?
The text was updated successfully, but these errors were encountered: