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 When I assign a scalar to an ndarray, it sometimes doesn't work!
To Reproduce
import taichi as ti ti.init(arch=ti.gpu) g = ti.ndarray(ti.int8, shape=(11, 5)) g.fill(1) g[1, 2] = 2 assert g[1, 2] == 2
Log/Screenshots
$ python tests/ndarray_weird_behaviour.py [Taichi] version 1.7.1, llvm 15.0.7, commit 0f143b2f, osx, python 3.10.9 [Taichi] Starting on arch=metal Traceback (most recent call last): File "/Users/agravier/projects/perso/arc/archi/tests/ndarray_weird_behaviour.py", line 9, in <module> assert g[1, 2] == 2 AssertionError
Additional comments
In a more complex program, the behaviour is affected by other operations. For instance, this works:
from itertools import product import taichi as ti ti.init(arch=ti.gpu) g = ti.ndarray(ti.int8, shape=(11, 5)) g.fill(1) for i, j in product(range(11), range(5)): g[i, j] = i*j+1 print(g.to_numpy()) assert g[1, 2] == 3
Moreover, this one works too (!):
import taichi as ti ti.init(arch=ti.gpu) g = ti.ndarray(ti.int8, shape=(11, 5)) g.fill(1) g[1, 2] = 2 g[1, 2] = 2 assert g[1, 2] == 2
I suspect that it's sometimes the first assignment that fails.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When I assign a scalar to an ndarray, it sometimes doesn't work!
To Reproduce
Log/Screenshots
Additional comments
In a more complex program, the behaviour is affected by other operations. For instance, this works:
Moreover, this one works too (!):
I suspect that it's sometimes the first assignment that fails.
The text was updated successfully, but these errors were encountered: