taichi.lang.util
¶
Module Contents¶
Functions¶
Whether has pytorch in the current Python environment. |
|
|
|
|
Convert taichi data type to its counterpart in numpy. |
|
Convert taichi data type to its counterpart in torch. |
|
Convert numpy or torch data type to its counterpart in taichi. |
|
|
|
|
|
- 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)¶