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 want to use 1 << a[1] in taichi scope, where a is a taichi field, but a TypeError is raised.
1 << a[1]
a
To Reproduce
Run the code below.
import taichi as ti ti.init(debug = True) a = ti.field(dtype = ti.i32, shape = 3) @ti.kernel def fun(): print(1 << a[1]) a[1] = 2 #print(1 << a[1]) #this line works properly fun()
Log/Screenshots
bx2k@bx2k-MagicBook:/mnt/c/Users/BillXu2000/Desktop$ cmd.exe /c python3 test.py [Taichi] mode=release [Taichi] version 0.7.0, llvm 10.0.0, commit 0298bca3, win, python 3.8.6 [Taichi] Starting on arch=x64 [Taichi] materializing... Traceback (most recent call last): File "test.py", line 11, in <module> fun() File "C:\Users\BillXu2000\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pa ckages\Python38\site-packages\taichi\lang\kernel.py", line 574, in wrapped return primal(*args, **kwargs) File "C:\Users\BillXu2000\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pa ckages\Python38\site-packages\taichi\lang\kernel.py", line 501, in __call__ self.materialize(key=key, args=args, arg_features=arg_features) File "C:\Users\BillXu2000\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pa ckages\Python38\site-packages\taichi\lang\kernel.py", line 370, in materialize taichi_kernel = taichi_kernel.define(taichi_ast_generator) File "C:\Users\BillXu2000\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pa ckages\Python38\site-packages\taichi\lang\kernel.py", line 367, in taichi_ast_generator compiled() File "test.py", line 7, in fun print(1 << a[1]) TypeError: unsupported operand type(s) for <<: 'int' and 'Expr'
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
I want to use
1 << a[1]
in taichi scope, wherea
is a taichi field, but a TypeError is raised.To Reproduce
Run the code below.
Log/Screenshots
The text was updated successfully, but these errors were encountered: