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
Description
When do assignment to a VectorField f = ti.Vector.field(2, float, shape=(2, 1)) (i.e. f[i,j][k] = 2.0), f[0,0][0] cannot be assigned right value.
f = ti.Vector.field(2, float, shape=(2, 1))
f[i,j][k] = 2.0
f[0,0][0]
To Reproduce Here's a sample_code.py to reproduce the bug.
import taichi as ti ti.init(arch=ti.gpu) f = ti.Vector.field(2, float, shape=(2, 1)) feq = ti.Vector.field(2, float, shape=(2, 1)) @ti.kernel def foo(): f[0, 0][0] = 1.0 # The bug at here f[0, 0][1] = 2.0 f[1, 0][0] = 3.0 f[1, 0][1] = 4.0 print('f[0, 0] =', f[0, 0]) print('f[1, 0] =', f[1, 0]) feq[0, 0] = f[0, 0] feq[1, 0] = f[1, 0] print('feq[0, 0] =', feq[0, 0]) print('feq[1, 0] =', feq[1, 0]) f[0, 0][1] = 5.0 print('f[0, 0] =', f[0, 0]) print('feq[0, 0] =', feq[0, 0]) foo()
Log
When in TaiChi v.1.7, wrong result shows like this.
$ python sample_code.py [Taichi] version 1.7.1, llvm 15.0.1, commit 0f143b2f, win, python 3.10.14 [Taichi] Starting on arch=cuda f[0, 0] = [0.000000, 2.000000] f[1, 0] = [3.000000, 4.000000] feq[0, 0] = [0.000000, 2.000000] feq[1, 0] = [3.000000, 4.000000] f[0, 0] = [0.000000, 5.000000] feq[0, 0] = [0.000000, 2.000000]
When in TaiChi v.1.6, correct result shows like this:
$ python sample_code.py [Taichi] version 1.6.0, llvm 15.0.1, commit f1c6fbbd, win, python 3.9.16 [Taichi] Starting on arch=cuda f[0, 0] = [1.000000, 2.000000] f[1, 0] = [3.000000, 4.000000] feq[0, 0] = [1.000000, 2.000000] feq[1, 0] = [3.000000, 4.000000] f[0, 0] = [1.000000, 5.000000] feq[0, 0] = [1.000000, 2.000000]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When do assignment to a VectorField
f = ti.Vector.field(2, float, shape=(2, 1))
(i.e.f[i,j][k] = 2.0
),f[0,0][0]
cannot be assigned right value.To Reproduce
Here's a sample_code.py to reproduce the bug.
Log
When in TaiChi v.1.7, wrong result shows like this.
When in TaiChi v.1.6, correct result shows like this:
The text was updated successfully, but these errors were encountered: