Hello, can anyone tell me how to create an array in taichi kernel and loop through it?
I have a sample code here:
@ti.kernel
def intersect(self):
for i in self.X:
v = 1.0
rad_arr = np.arange(0.02, v+0.02, v/5.0)
and my error is the following:
File "myfilename.py", line 234, in solve
self.intersect()
File "/usr/local/lib/python3.7/site-packages/taichi/lang/kernel.py", line 606, in __call__
return self._primal(self._kernel_owner, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/taichi/lang/kernel.py", line 501, in __call__
self.materialize(key=key, args=args, arg_features=arg_features)
File "/usr/local/lib/python3.7/site-packages/taichi/lang/kernel.py", line 370, in materialize
taichi_kernel = taichi_kernel.define(taichi_ast_generator)
File "/usr/local/lib/python3.7/site-packages/taichi/lang/kernel.py", line 367, in taichi_ast_generator
compiled()
File "myfilename.py", line 143, in intersect
rad_arr = np.arange(0.02, v+0.02, v/5.0)
TypeError: must be real number, not Expr