import taichi as ti

ti.init(arch=ti.gpu)

n = 320
pixels = ti.var(dt=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

paint(0.3)
print(pixels.to_numpy())
# [[0.3        0.30200002 0.30400002 ... 0.934      0.93600005 0.938     ]
#  [0.301      0.303      0.305      ... 0.935      0.93700004 0.939     ]
#  [0.30200002 0.30400002 0.30600002 ... 0.93600005 0.938      0.94000006]
#  ...
#  [0.93700004 0.939      0.94100004 ... 1.5710001  1.5730001  1.575     ]
#  [0.938      0.94       0.94200003 ... 1.572      1.574      1.5760001 ]
#  [0.93900007 0.94100004 0.9430001  ... 1.5730001  1.575      1.5770001 ]]

8a60049c5e0794672bdc7928e38976c09f4b1c48
<mask token>

<mask token>
ti.init(arch=ti.gpu)
<mask token>


@ti.kernel
def paint(t: ti.f32):
    for i, j in pixels:
        pixels[i, j] = i * 0.001 + j * 0.002 + t


paint(0.3)
print(pixels.to_numpy())

<mask token>
ti.init(arch=ti.gpu)
n = 320
pixels = ti.var(dt=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


paint(0.3)
print(pixels.to_numpy())

import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.var(dt=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


paint(0.3)
print(pixels.to_numpy())

import taichi as ti

ti.init(arch=ti.gpu)

n = 320
pixels = ti.var(dt=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

paint(0.3)
print(pixels.to_numpy())
# [[0.3        0.30200002 0.30400002 ... 0.934      0.93600005 0.938     ]
#  [0.301      0.303      0.305      ... 0.935      0.93700004 0.939     ]
#  [0.30200002 0.30400002 0.30600002 ... 0.93600005 0.938      0.94000006]
#  ...
#  [0.93700004 0.939      0.94100004 ... 1.5710001  1.5730001  1.575     ]
#  [0.938      0.94       0.94200003 ... 1.572      1.574      1.5760001 ]
#  [0.93900007 0.94100004 0.9430001  ... 1.5730001  1.575      1.5770001 ]]
