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
I have been trying taichi to improve the speed of heavily looped numpy based calculations. I am happy with the speed, but stuck in simple operations.
I cannot find a simple way to sum up all elements of the following taichi field
CON = ti.field(ti.f32, shape=(M,N,O))
I am looking for something like numpy.sum(CON) without having to loop over M,N,O dimensions
Also I would like to know how to multiple all elements of CON with a constant. For example,
CON = ti.field(ti.f32, shape=(M,N,O))
x = 0.5
CON = CON*x # but this throws a taichi scope error
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
-
I have been trying taichi to improve the speed of heavily looped numpy based calculations. I am happy with the speed, but stuck in simple operations.
I cannot find a simple way to sum up all elements of the following taichi field
CON = ti.field(ti.f32, shape=(M,N,O))
I am looking for something like numpy.sum(CON) without having to loop over M,N,O dimensions
Also I would like to know how to multiple all elements of CON with a constant. For example,
CON = ti.field(ti.f32, shape=(M,N,O))
x = 0.5
CON = CON*x # but this throws a taichi scope error
Your suggestions are greatly appreciated
Archana
Beta Was this translation helpful? Give feedback.
All reactions