Skip to content

Commit 22549ed

Browse files
committed
fix python scopecalsll
1 parent ed74c22 commit 22549ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/gstaichi/lang/func.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def __call__(self: "Func", *py_args, **kwargs) -> Any:
5555
runtime = impl.get_runtime()
5656
global_context = runtime._current_global_context
5757
current_kernel = global_context.current_kernel if global_context is not None else None
58-
assert current_kernel is not None
5958
py_args = self.process_args(
6059
is_func=True, is_pyfunc=self.pyfunc, py_args=py_args, kwargs=kwargs, global_context=global_context
6160
)
@@ -65,6 +64,7 @@ def __call__(self: "Func", *py_args, **kwargs) -> Any:
6564
raise GsTaichiSyntaxError("GsTaichi functions cannot be called from Python-scope.")
6665
return self.func(*py_args)
6766

67+
assert current_kernel is not None
6868
if self.is_real_function:
6969
if current_kernel.autodiff_mode != _NONE:
7070
raise GsTaichiSyntaxError("Real function in gradient kernels unsupported.")

0 commit comments

Comments
 (0)