import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.var(ti.f32, shape=(n * 2, n))
@ti.kernel
def paint(t: ti.f32):
for i, j in pixels:
pixels[i, j] = i * 0.001 + j * 0.002 + t
print(pixels)
import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.var(ti.f32, shape=(n * 2, n))
@ti.kernel
def paint(t: ti.f32):
for i, j in pixels:
pixels[i, j] = i * 0.001 + j * 0.002 + t
print(pixels)
这打印的结果是一个对象,不是整个数组,有什么方法能够打印整个数组
print(pixels.to_numpy())