You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, the Following code give me an error "AttributeError: 'ScalarField' object has no attribute 'astype'. Did you mean: 'dtype'?"
but works fine if I use a numpy array. If i print them out they are identical. Whats the issue here? thanks
`import taichi as ti
import numpy as np
ti.init(arch=ti.vulkan)
gui = ti.GUI('Circles Test', res=(640, 480))
numpoints = 20
centres = ti.field(ti.f32, shape=(numpoints, 2))
#centres = np.random.random((50, 2))
@ti.kernel
def randompoints():
for i, j in centres:
centres[i,j] =ti.random()
randompoints()
print(centres)
#center = [0.3, 0.5]
while gui.running:
gui.circles(centres, radius= 20, color=0xEEEEF0)
gui.show()`
Beta Was this translation helpful? Give feedback.
All reactions