Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Function redifined in python/taichi/lang/__init__.py #3227

Open
gaocegege opened this issue Oct 19, 2021 · 0 comments
Open

[misc] Function redifined in python/taichi/lang/__init__.py #3227

gaocegege opened this issue Oct 19, 2021 · 0 comments

Comments

Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
@gaocegege
Copy link
Collaborator

@gaocegege gaocegege commented Oct 19, 2021

Describe the bug

python/taichi/lang/__init__.py:

from taichi.lang.impl import *

def reset():
    """Resets Taichi to its initial state.

    This would destroy all the fields and kernels.
    """
    _ti_core.reset_snode_access_flag()
    impl.reset()
    global runtime
    runtime = impl.get_runtime()

There is a func reset in python/taichi/lang/init.py, which is already defined at taichi.lang.impl

python/taichi/lang/impl.py:

def reset():
    global pytaichi
    old_kernels = pytaichi.kernels
    pytaichi.clear()
    pytaichi = PyTaichi(old_kernels)
    for k in old_kernels:
        k.reset()
    _ti_core.reset_default_compile_config()

The IDE always raises an error here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment