From 617f10116fce71f93e9f47f48cc8840c0a19f86a Mon Sep 17 00:00:00 2001 From: Dan Moldovan Date: Wed, 17 Jul 2019 08:41:55 -0700 Subject: [PATCH] Avoid converting the old-style print statement, because it would otherwise generate a syntax error. PiperOrigin-RevId: 258575670 --- .../python/autograph/converters/call_trees.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tensorflow/python/autograph/converters/call_trees.py b/tensorflow/python/autograph/converters/call_trees.py index 853cd44331c..657d880620f 100644 --- a/tensorflow/python/autograph/converters/call_trees.py +++ b/tensorflow/python/autograph/converters/call_trees.py @@ -142,22 +142,6 @@ class CallTreeTransformer(converter.Base): return new_call - def visit_Print(self, node): - node = self.generic_visit(node) - args = node.values - # Following is the case when calling print(a, b) - if len(args) == 1 and isinstance(args[0], gast.Tuple): - args = args[0].elts - - template = """ - ag__.converted_call(func, None, options, args, {}) - """ - return templates.replace_as_expression( - template, - func='print', - options=self.ctx.program.options.to_ast(), - args=args) - def transform(node, ctx): """Transform function call to the compiled counterparts. -- GitLab