How to use the taichi.root function in taichi

To help you get started, we’ve selected a few taichi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yuanming-hu / taichi / tests / python / test_sparse_parallel.py View on Github external
def place():
    ti.root.dense(ti.i, n).pointer().dense(ti.i, n).place(x)
    ti.root.place(s)
github yuanming-hu / taichi / tests / python / test_fill.py View on Github external
def values():
    ti.root.dense(ti.ij, (n, m)).place(val)
github yuanming-hu / taichi / examples / difftaichi / diffmpm_benchmark.py View on Github external
def p(x):
    for i in x.entries:
      ti.root.dense(ti.l, max_steps).dense(ti.k, n_particles).place(i)
      ti.root.dense(ti.l, max_steps).dense(ti.k, n_particles).place(i.grad)
github yuanming-hu / taichi / examples / difftaichi / gradient_explosion.py View on Github external
def place():
  ti.root.dense(ti.i, max_timesteps).place(x, v)
  ti.root.place(a, damping, loss)
  ti.root.lazy_grad()
github yuanming-hu / taichi / examples / difftaichi / diffmpm_llvm.py View on Github external
def place():
  ti.root.dense(ti.ij, (n_actuators, n_sin_waves)).place(weights)
  ti.root.dense(ti.i, n_actuators).place(bias)
  
  ti.root.dense(ti.ij, (max_steps, n_actuators)).place(actuation)
  ti.root.dense(ti.i, n_particles).place(actuator_id, particle_type)
  ti.root.dense(ti.l, max_steps).dense(ti.k, n_particles).place(x, v, C, F)
  ti.root.dense(ti.ij, n_grid).place(grid_v_in, grid_m_in, grid_v_out)
  ti.root.place(loss, x_avg)
  
  ti.root.lazy_grad()
github yuanming-hu / taichi / examples / difftaichi / wave.py View on Github external
def place():
  ti.root.dense(ti.l, max_steps).dense(ti.ij, n_grid).place(p)
  ti.root.dense(ti.l, max_steps).dense(ti.ij, n_grid).place(p.grad)
  ti.root.dense(ti.ij, n_grid).place(target)
  ti.root.dense(ti.ij, n_grid).place(target.grad)
  ti.root.dense(ti.ij, n_grid).place(initial)
  ti.root.dense(ti.ij, n_grid).place(initial.grad)
  ti.root.place(loss)
  ti.root.place(loss.grad)