From 4113b0d79baaf11eca169eb1af66d90c059de2c4 Mon Sep 17 00:00:00 2001 From: archibate <17721388340@163.com> Date: Thu, 27 Feb 2020 14:21:41 +0800 Subject: [PATCH] no print_preprocessed or 1 --- python/taichi/lang/kernel.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/taichi/lang/kernel.py b/python/taichi/lang/kernel.py index 3b9cefe565e3c8..8c195db1ba5878 100644 --- a/python/taichi/lang/kernel.py +++ b/python/taichi/lang/kernel.py @@ -50,7 +50,7 @@ def do_compile(self): func_body = tree.body[0] func_body.decorator_list = [] - if get_runtime().print_preprocessed or 1: + if get_runtime().print_preprocessed: import astor print('Before preprocessing:') print(astor.to_source(tree.body[0], indent_with=' ')) @@ -59,7 +59,7 @@ def do_compile(self): visitor.visit(tree) ast.fix_missing_locations(tree) - if get_runtime().print_preprocessed or 1: + if get_runtime().print_preprocessed: import astor print('After preprocessing:') print(astor.to_source(tree.body[0], indent_with=' ')) @@ -213,7 +213,7 @@ def materialize(self, key=None, args=None, arg_features=None): src = remove_indent(inspect.getsource(self.func)) tree = ast.parse(src) - if self.runtime.print_preprocessed or 1: + if self.runtime.print_preprocessed: import astor print('Before preprocessing:') print(astor.to_source(tree.body[0])) @@ -239,7 +239,7 @@ def materialize(self, key=None, args=None, arg_features=None): visitor.visit(tree) ast.fix_missing_locations(tree) - if self.runtime.print_preprocessed or 1: + if self.runtime.print_preprocessed: import astor print('After preprocessing:') print(astor.to_source(tree.body[0], indent_with=' '))