How to use the taichi.root.dense 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_struct.py View on Github external
def place():
    ti.root.dense(ti.ij, n // 16).dense(ti.ij, (32, 16)).place(x)
github yuanming-hu / taichi / tests / python / test_struct.py View on Github external
  @ti.layout
  def place():
    ti.root.dense(ti.ij, n // 16).dense(ti.ij, (32, 16)).place(x)
github yuanming-hu / taichi / tests / python / test_struct_for.py View on Github external
def place():
    ti.root.dense(ti.i, n // 4).dense(ti.i, 4).place(x)
    ti.root.dense(ti.i, n).place(y)
github yuanming-hu / taichi / tests / python / test_ad_basics.py View on Github external
def place():
    ti.root.dense(ti.i, 1).place(x, x.grad, y, y.grad)
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 / misc / benchmark_compile.py View on Github external
def place():
    ti.root.dense(ti.i, 1).place(x, x.grad, y, y.grad)
github yuanming-hu / taichi / examples / minimization_trivial.py View on Github external
def data():
  ti.root.dense(ti.i, n).place(x, y, x.grad, y.grad)  # place gradient tensors
  ti.root.place(L, L.grad)
github yuanming-hu / taichi / examples / difftaichi / liquid.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.ijk, n_grid).place(grid_v_in, grid_m_in, grid_v_out)
  ti.root.place(loss, x_avg)
  ti.root.dense(ti.ij,
                (visualize_resolution, visualize_resolution)).place(screen)

  ti.root.lazy_grad()