From a7849db561df9bf7a2c5961df63a861106f90b43 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Fri, 24 Aug 2018 00:47:41 +0800 Subject: [PATCH] Port new added code --- python/paddle/fluid/tests/unittests/test_attention_lstm_op.py | 2 +- python/paddle/fluid/transpiler/details/program_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_attention_lstm_op.py b/python/paddle/fluid/tests/unittests/test_attention_lstm_op.py index a7382c2244e..1b9c3efe0fa 100644 --- a/python/paddle/fluid/tests/unittests/test_attention_lstm_op.py +++ b/python/paddle/fluid/tests/unittests/test_attention_lstm_op.py @@ -37,7 +37,7 @@ def attention_lstm( T = sum(lod[0]) N = len(lod[0]) M = x.shape[1] - D = b.shape[1] / 4 + D = b.shape[1] // 4 assert T == x.shape[0] assert len(fcws) == len(fcbs) hidden = [] diff --git a/python/paddle/fluid/transpiler/details/program_utils.py b/python/paddle/fluid/transpiler/details/program_utils.py index 420ae6dfd4b..64863aceee1 100644 --- a/python/paddle/fluid/transpiler/details/program_utils.py +++ b/python/paddle/fluid/transpiler/details/program_utils.py @@ -159,7 +159,7 @@ def program_to_code(prog): get_indent_space(indent), '{', block_idx)) indent += 1 # sort all vars - all_vars = sorted(block.vars.iteritems(), key=lambda x: x[0]) + all_vars = sorted(six.iteritems(block.vars), key=lambda x: x[0]) for var in all_vars: print("{}{}".format( get_indent_space(indent), variable_to_code(var[1]))) -- GitLab