docs.taichi.graphics
docs.taichi.graphics copied to clipboard
The code snippet about ti.Vector is not working
I find that the below code is not working. the taichi version is 1.1.2. The code is placed at field.md
f = ti.Vector(ti.f32, n=2).field(shape=(1,2,3))
Is this the old syntax?
@neozhaoliang Please could you take a look?
@cooperliu101 The function ti.Vector requires an input array, it does not support the syntax ti.Vector(dtype, n).
The code is placed at field.md we should fix the doc
@cooperliu101 Could please add the link to that line?
The 1.1.3 version doc have replaced with new code contents.
The below link is the old version. https://github.com/taichi-dev/docs.taichi.graphics/blob/master/website/versioned_docs/version-v1.1.2/lang/articles/basic/field.md#declaration-1
Thanks. The line below in the link is wrong and we have fixed it in v1.1.3:
# Declare a 1x2x3 vector field whose vector dimension is n=2
f = ti.Vector(ti.f32, n=2).field(shape=(1,2,3))
The correct syntax isti.Vector.field, not ti.Vector().field().