From 9f3a325222968fff61027f6003752a637de27584 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Wed, 27 Feb 2019 10:56:04 +0800 Subject: [PATCH] add deprecation warning. test=develop --- python/paddle/fluid/parallel_executor.py | 5 +++++ python/paddle/fluid/transpiler/inference_transpiler.py | 2 ++ .../fluid/transpiler/memory_optimization_transpiler.py | 2 ++ 3 files changed, 9 insertions(+) diff --git a/python/paddle/fluid/parallel_executor.py b/python/paddle/fluid/parallel_executor.py index 889156ff7..fa8d5ef5d 100644 --- a/python/paddle/fluid/parallel_executor.py +++ b/python/paddle/fluid/parallel_executor.py @@ -92,6 +92,11 @@ class ParallelExecutor(object): num_trainers=1, trainer_id=0, scope=None): + sys.stderr.write( + 'ParallelExecutor is deprecated. ' + 'Please use CompiledProgram and Executor. CompiledProgram ' + 'is a central place for optimization and Executor is the ' + 'unified executor. Example can be found in compiler.py.\n') # step1: get places, the places are used in run too. self._places = [] if use_cuda: diff --git a/python/paddle/fluid/transpiler/inference_transpiler.py b/python/paddle/fluid/transpiler/inference_transpiler.py index cc7f5ec90..fea10d7c3 100644 --- a/python/paddle/fluid/transpiler/inference_transpiler.py +++ b/python/paddle/fluid/transpiler/inference_transpiler.py @@ -15,6 +15,7 @@ from __future__ import print_function import os +import sys import numpy as np from .. import core from ..framework import Program @@ -50,6 +51,7 @@ class InferenceTranspiler(object): place (Place): inference place scope (Scope|None): inference Scope ''' + sys.stderr.write('InferenceTranspiler is deprecated.\n') if not isinstance(program, Program): raise TypeError("program should be as Program type") if not isinstance(place, core.CPUPlace) and not isinstance( diff --git a/python/paddle/fluid/transpiler/memory_optimization_transpiler.py b/python/paddle/fluid/transpiler/memory_optimization_transpiler.py index ee8cde441..f3c7b3d63 100755 --- a/python/paddle/fluid/transpiler/memory_optimization_transpiler.py +++ b/python/paddle/fluid/transpiler/memory_optimization_transpiler.py @@ -15,6 +15,7 @@ from __future__ import print_function import six +import sys from collections import defaultdict, MutableSet from .. import core from ... import compat as cpt @@ -509,6 +510,7 @@ def memory_optimize(input_program, Returns: None """ + sys.stderr.write('memory_optimize is deprecated.\n') def to_name_str(var): if isinstance(var, Variable): -- GitLab