From 10b062d943ad5e77d80ca0e32c8ca599175738d4 Mon Sep 17 00:00:00 2001 From: Lin Jiang Date: Sat, 11 Mar 2023 01:23:36 +0800 Subject: [PATCH] [Lang] Keep ti.pyfunc (#7530) Issue: fixes #7324 ### Brief Summary --- python/taichi/__init__.py | 1 - python/taichi/lang/kernel_impl.py | 2 +- tests/python/test_api.py | 15 ++++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/taichi/__init__.py b/python/taichi/__init__.py index 713007603917f..9cd0c07493cde 100644 --- a/python/taichi/__init__.py +++ b/python/taichi/__init__.py @@ -52,7 +52,6 @@ 'lang.misc._serialize'), 'block_dim': ('Please use ti.loop_config(block_dim=...) instead.', 'lang.misc._block_dim'), - 'pyfunc': ('Please avoid using it.', 'lang.kernel_impl.pyfunc'), 'TriMesh': ('Please import meshtaichi_patcher as Patcher and use Patcher.load_mesh(...) instead.', 'lang.mesh._TriMesh'), diff --git a/python/taichi/lang/kernel_impl.py b/python/taichi/lang/kernel_impl.py index dbc64fa3340d9..0f6603c44d7b9 100644 --- a/python/taichi/lang/kernel_impl.py +++ b/python/taichi/lang/kernel_impl.py @@ -1149,4 +1149,4 @@ def _getattr(self, item): return cls -__all__ = ["data_oriented", "func", "kernel"] +__all__ = ["data_oriented", "func", "kernel", "pyfunc"] diff --git a/tests/python/test_api.py b/tests/python/test_api.py index cbb6c16cb4713..7809f8ddd1ed1 100644 --- a/tests/python/test_api.py +++ b/tests/python/test_api.py @@ -76,13 +76,14 @@ def _get_expected_matrix_apis(): 'j', 'jk', 'jkl', 'jl', 'k', 'kernel', 'kl', 'l', 'lang', 'length', 'linalg', 'log', 'loop_config', 'math', 'max', 'mesh_local', 'mesh_patch_idx', 'metal', 'min', 'ndarray', 'ndrange', 'no_activate', - 'one', 'opengl', 'polar_decompose', 'pow', 'profiler', 'randn', 'random', - 'raw_div', 'raw_mod', 'ref', 'rescale_index', 'reset', 'rgb_to_hex', - 'root', 'round', 'rsqrt', 'select', 'set_logging_level', 'simt', 'sin', - 'solve', 'sparse_matrix_builder', 'sqrt', 'static', 'static_assert', - 'static_print', 'stop_grad', 'svd', 'sym_eig', 'sync', 'tan', 'tanh', - 'template', 'tools', 'types', 'u16', 'u32', 'u64', 'u8', 'ui', 'uint16', - 'uint32', 'uint64', 'uint8', 'vulkan', 'wasm', 'x64', 'x86_64', 'zero' + 'one', 'opengl', 'polar_decompose', 'pow', 'profiler', 'pyfunc', 'randn', + 'random', 'raw_div', 'raw_mod', 'ref', 'rescale_index', 'reset', + 'rgb_to_hex', 'root', 'round', 'rsqrt', 'select', 'set_logging_level', + 'simt', 'sin', 'solve', 'sparse_matrix_builder', 'sqrt', 'static', + 'static_assert', 'static_print', 'stop_grad', 'svd', 'sym_eig', 'sync', + 'tan', 'tanh', 'template', 'tools', 'types', 'u16', 'u32', 'u64', 'u8', + 'ui', 'uint16', 'uint32', 'uint64', 'uint8', 'vulkan', 'wasm', 'x64', + 'x86_64', 'zero' ] user_api[ti.ad] = [ 'FwdMode', 'Tape', 'clear_all_gradients', 'grad_for', 'grad_replaced',