Open Jingzheng-Li opened 1 year ago
I think the key problem is that you placed the field in a kernel.
@ti.kernel
def init_field(self):
ti.root.dense(ti.i, 10).place(self.testfield)
Please checkout the raster example for the normal usage :) https://github.com/taichi-dev/taichi/blob/master/python/taichi/examples/rendering/rasterizer.py#L24-L43
Dear Taichi staff, I want to use data_oriented to complete an inheritance class, define the field in the first class, and modify the field in the second class (such as the following simplified program), but if I use the such "root place" way to write it, there will be an error that some fileds are not placed:
However, if I define field with a specified field, the code will be normal
Therefore, my question is that how can I modify the first code to get correct answer?