taichi.lang.any_array

Module Contents

Classes

AnyArray

Class for arbitrary arrays in Python AST.

AnyArrayAccess

Class for first-level access to AnyArray with Vector/Matrix elements in Python AST.

class taichi.lang.any_array.AnyArray(ptr, element_shape, layout)

Class for arbitrary arrays in Python AST.

Parameters
  • ptr (taichi_core.Expr) – A taichi_core.Expr wrapping a taichi_core.ExternalTensorExpression.

  • element_shape (Tuple[Int]) – () if scalar elements (default), (n) if vector elements, and (n, m) if matrix elements.

  • layout (Layout) – Memory layout.

property shape(self)

A list containing sizes for each dimension. Note that element shape will be excluded.

Returns

The result list.

Return type

List[Int]

loop_range(self)

Gets the corresponding taichi_core.Expr to serve as loop range.

This is not in use now because struct fors on AnyArrays are not supported yet.

Returns

See above.

Return type

taichi_core.Expr

class taichi.lang.any_array.AnyArrayAccess(arr, indices_first)

Class for first-level access to AnyArray with Vector/Matrix elements in Python AST.

Parameters
  • arr (AnyArray) – See above.

  • indices_first (Tuple[Int]) – Indices of first-level access.

subscript(self, i, j)