def __init__(self):
self.vn_object_index = ti.field(dtype=ti.i32, shape=self.on)
self.count = ti.field(dtype=ti.i32, shape=())
...
...
@ti.kernel
def calc_x_bar(self):
for i in range(self.vn_object_index[self.count]):
self.node[i] = self.bar_node[i]
请问这段代码执行的时候会报错是什么原因导致的呢?
taichi.lang.exception.TaichiTypeError: in calc_x_bar:
for i in range(self.vn_object_index[self.count]):
Invalid constant scalar data type: <class 'taichi.lang.field.ScalarField'>
源代码是这里的 ipc2d.py