From 6bd3ed92387c0d67b68936c7a13986e21d924241 Mon Sep 17 00:00:00 2001 From: Dang Qingqing Date: Thu, 20 Sep 2018 11:51:38 +0000 Subject: [PATCH] Fix unit test in Python3.5 --- python/paddle/fluid/__init__.py | 2 +- python/paddle/fluid/contrib/tests/test_quantize_transpiler.py | 2 +- python/paddle/fluid/transpiler/__init__.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/__init__.py b/python/paddle/fluid/__init__.py index 9e4a5ae8baa..1ca2ac2ddc7 100644 --- a/python/paddle/fluid/__init__.py +++ b/python/paddle/fluid/__init__.py @@ -46,7 +46,7 @@ from . import transpiler from .param_attr import ParamAttr, WeightNormParamAttr from .data_feeder import DataFeeder from .core import LoDTensor, LoDTensorArray, CPUPlace, CUDAPlace, CUDAPinnedPlace, Scope -from .transpiler import DistributeTranspiler, \ +from .transpiler import DistributeTranspiler, InferenceTranspiler, \ memory_optimize, release_memory, DistributeTranspilerConfig from .lod_tensor import create_lod_tensor, create_random_int_lodtensor from . import clip diff --git a/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py b/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py index 8800be68f8f..c8ab20c459d 100644 --- a/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py +++ b/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py @@ -210,7 +210,7 @@ class TestQuantizeTranspiler(unittest.TestCase): with fluid.program_guard(main): for _ in range(iter): - data = train_reader().next() + data = next(train_reader()) loss_v = exe.run(program=main, feed=feeder.feed(data), fetch_list=[loss]) diff --git a/python/paddle/fluid/transpiler/__init__.py b/python/paddle/fluid/transpiler/__init__.py index c5d2502ddbb..c9a8176a72f 100644 --- a/python/paddle/fluid/transpiler/__init__.py +++ b/python/paddle/fluid/transpiler/__init__.py @@ -15,6 +15,7 @@ from __future__ import print_function from .distribute_transpiler import DistributeTranspiler, DistributeTranspilerConfig +from .inference_transpiler import InferenceTranspiler from .memory_optimization_transpiler import memory_optimize, release_memory from .ps_dispatcher import HashName, RoundRobin -- GitLab