From 97e051fa52e20757cb630f7dfc0ccc7c2df9505e Mon Sep 17 00:00:00 2001 From: lin-hitonami Date: Fri, 5 Nov 2021 14:13:50 +0800 Subject: [PATCH] format --- python/taichi/lang/ast_builder_utils.py | 2 +- python/taichi/lang/ir_builder.py | 1 - tests/python/test_ast_refactor.py | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/taichi/lang/ast_builder_utils.py b/python/taichi/lang/ast_builder_utils.py index c0906a6591cda..787a945cec316 100644 --- a/python/taichi/lang/ast_builder_utils.py +++ b/python/taichi/lang/ast_builder_utils.py @@ -1,7 +1,7 @@ import ast +from enum import Enum from taichi.lang.exception import TaichiSyntaxError -from enum import Enum class Builder(object): diff --git a/python/taichi/lang/ir_builder.py b/python/taichi/lang/ir_builder.py index b994e27751910..11132865ffb16 100644 --- a/python/taichi/lang/ir_builder.py +++ b/python/taichi/lang/ir_builder.py @@ -726,4 +726,3 @@ def build_stmts(ctx, stmts): else: result.append(stmt) return result - diff --git a/tests/python/test_ast_refactor.py b/tests/python/test_ast_refactor.py index c157640396650..1c13f19fc83b8 100644 --- a/tests/python/test_ast_refactor.py +++ b/tests/python/test_ast_refactor.py @@ -415,6 +415,7 @@ def func(): @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_static_for_break(): n = 10 + @ti.kernel def foo(a: ti.template()): for i in ti.static(range(n)): @@ -438,6 +439,7 @@ def foo(a: ti.template()): @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_static_grouped_for_break(): n = 4 + @ti.kernel def foo(a: ti.template()): for I in ti.static(ti.grouped(ti.ndrange(n, n))): @@ -462,6 +464,7 @@ def foo(a: ti.template()): @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_static_for_continue(): n = 10 + @ti.kernel def foo(a: ti.template()): for i in ti.static(range(n)): @@ -483,6 +486,7 @@ def foo(a: ti.template()): @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_static_grouped_for_continue(): n = 4 + @ti.kernel def foo(a: ti.template()): for I in ti.static(ti.grouped(ti.ndrange(n, n))): @@ -505,6 +509,7 @@ def foo(a: ti.template()): @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_for_break(): n = 4 + @ti.kernel def foo(a: ti.template()): for i in range(n): @@ -530,6 +535,7 @@ def foo(a: ti.template()): @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_for_continue(): n = 4 + @ti.kernel def foo(a: ti.template()): for i in range(n):