taichi.lang.util

Module Contents

Functions

has_pytorch()

Whether has pytorch in the current Python environment.

has_clangpp()

get_clangpp()

is_taichi_class(rhs)

to_numpy_type(dt)

Convert taichi data type to its counterpart in numpy.

to_pytorch_type(dt)

Convert taichi data type to its counterpart in torch.

to_taichi_type(dt)

Convert numpy or torch data type to its counterpart in taichi.

cook_dtype(dtype)

in_taichi_scope()

in_python_scope()

taichi_scope(func)

python_scope(func)

taichi.lang.util.has_pytorch()

Whether has pytorch in the current Python environment.

Returns

True if has pytorch else False.

Return type

bool

taichi.lang.util.has_clangpp()
taichi.lang.util.get_clangpp()
taichi.lang.util.is_taichi_class(rhs)
taichi.lang.util.to_numpy_type(dt)

Convert taichi data type to its counterpart in numpy.

Parameters

dt (DataType) – The desired data type to convert.

Returns

The counterpart data type in numpy.

Return type

DataType

taichi.lang.util.to_pytorch_type(dt)

Convert taichi data type to its counterpart in torch.

Parameters

dt (DataType) – The desired data type to convert.

Returns

The counterpart data type in torch.

Return type

DataType

taichi.lang.util.to_taichi_type(dt)

Convert numpy or torch data type to its counterpart in taichi.

Parameters

dt (DataType) – The desired data type to convert.

Returns

The counterpart data type in taichi.

Return type

DataType

taichi.lang.util.cook_dtype(dtype)
taichi.lang.util.in_taichi_scope()
taichi.lang.util.in_python_scope()
taichi.lang.util.taichi_scope(func)
taichi.lang.util.python_scope(func)