Skip to content

Commit 4b2794c

Browse files
committed
rename
test=release/1.3
1 parent 3c8726c commit 4b2794c

File tree

14 files changed

+35
-35
lines changed

14 files changed

+35
-35
lines changed

python/paddle/fluid/contrib/decoder/beam_search_decoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from __future__ import print_function
2424

25-
from ...wrapped_decorator import contextmanager
25+
from ...wrapped_decorator import signature_safe_contextmanager
2626
import numpy as np
2727
import six
2828

@@ -419,7 +419,7 @@ def __init__(self, state_cell, name=None):
419419
self._state_cell = state_cell
420420
self._state_cell._enter_decoder(self)
421421

422-
@contextmanager
422+
@signature_safe_contextmanager
423423
def block(self):
424424
"""
425425
Define the behavior of the decoder for each RNN time step.
@@ -613,7 +613,7 @@ def __init__(self,
613613
self._word_dim = word_dim
614614
self._input_var_dict = input_var_dict
615615

616-
@contextmanager
616+
@signature_safe_contextmanager
617617
def block(self):
618618
"""
619619
Define the behavior of the decoder for each RNN time step.

python/paddle/fluid/contrib/inferencer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import print_function
1616

17-
from ..wrapped_decorator import contextmanager
17+
from ..wrapped_decorator import signature_safe_contextmanager
1818

1919
from .. import core
2020

@@ -105,7 +105,7 @@ def infer(self, inputs, return_numpy=True):
105105

106106
return results
107107

108-
@contextmanager
108+
@signature_safe_contextmanager
109109
def _prog_and_scope_guard(self):
110110
with framework.program_guard(main_program=self.inference_program):
111111
with executor.scope_guard(self.scope):

python/paddle/fluid/contrib/trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import print_function
1616

17-
from ..wrapped_decorator import contextmanager
17+
from ..wrapped_decorator import signature_safe_contextmanager
1818
import os
1919
import errno
2020
import shutil
@@ -453,7 +453,7 @@ def save_inference_model(self, param_path, feeded_var_names,
453453
io.save_inference_model(param_path, feeded_var_names, target_vars,
454454
exe)
455455

456-
@contextmanager
456+
@signature_safe_contextmanager
457457
def _prog_and_scope_guard(self):
458458
with framework.program_guard(
459459
main_program=self.train_program,

python/paddle/fluid/executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import os
1818
import multiprocessing
1919
import numpy as np
20-
from .wrapped_decorator import contextmanager
20+
from .wrapped_decorator import signature_safe_contextmanager
2121
import six
2222
from .framework import Program, default_main_program, Variable
2323
from . import core
@@ -49,7 +49,7 @@ def _switch_scope(scope):
4949
return ex
5050

5151

52-
@contextmanager
52+
@signature_safe_contextmanager
5353
def scope_guard(scope):
5454
"""
5555
Change the global/default scope instance by Python `with` statement. All

python/paddle/fluid/framework.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import collections
1818
from collections import defaultdict
19-
from .wrapped_decorator import contextmanager
19+
from .wrapped_decorator import signature_safe_contextmanager
2020
import os
2121
import re
2222
import traceback
@@ -111,7 +111,7 @@ def name(self):
111111
_name_scope = NameScope()
112112

113113

114-
@contextmanager
114+
@signature_safe_contextmanager
115115
def name_scope(prefix=None):
116116
"""
117117
Generate hierarchical name prefix for the operators.
@@ -1775,7 +1775,7 @@ def op_role_var(self):
17751775
def set_op_role_var(self, var_name):
17761776
self._op_role_var = [var_name]
17771777

1778-
@contextmanager
1778+
@signature_safe_contextmanager
17791779
def _optimized_guard(self, param_and_grads):
17801780
"""
17811781
A with guard to set :code:`Optimization` :code:`OpRole` and
@@ -1805,7 +1805,7 @@ def _optimized_guard(self, param_and_grads):
18051805
self._op_role_var = tmp_var
18061806
self._current_role = tmp_role
18071807

1808-
@contextmanager
1808+
@signature_safe_contextmanager
18091809
def _lr_schedule_guard(self, is_with_opt=False):
18101810
"""
18111811
A with guard to set :code:`LRSched` :code:`OpRole` and
@@ -2459,7 +2459,7 @@ def switch_startup_program(program):
24592459
return prev_program
24602460

24612461

2462-
@contextmanager
2462+
@signature_safe_contextmanager
24632463
def program_guard(main_program, startup_program=None):
24642464
"""
24652465
Change the global main program and startup program with `with` statement.
@@ -2524,7 +2524,7 @@ def _get_var(name, program=None):
25242524
return program.global_block().var(name)
25252525

25262526

2527-
@contextmanager
2527+
@signature_safe_contextmanager
25282528
def _imperative_guard(tracer):
25292529
global _imperative_tracer_
25302530
tmp_trace = _imperative_tracer_
@@ -2535,7 +2535,7 @@ def _imperative_guard(tracer):
25352535
_imperative_tracer_ = tmp_trace
25362536

25372537

2538-
@contextmanager
2538+
@signature_safe_contextmanager
25392539
def _imperative_place_guard(place):
25402540
global _imperative_current_expected_place_
25412541
tmp_place = _imperative_current_expected_place_

python/paddle/fluid/imperative/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from ..wrapped_decorator import contextmanager
14+
from ..wrapped_decorator import signature_safe_contextmanager
1515
import numpy as np
1616

1717
from paddle.fluid import core
@@ -24,7 +24,7 @@ def enabled():
2424
return framework._in_imperative_mode()
2525

2626

27-
@contextmanager
27+
@signature_safe_contextmanager
2828
def guard(place=None):
2929
train = framework.Program()
3030
startup = framework.Program()

python/paddle/fluid/initializer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from . import framework
1818
import numpy as np
19-
from .wrapped_decorator import contextmanager
19+
from .wrapped_decorator import signature_safe_contextmanager
2020
from .core import VarDesc
2121
from . import unique_name
2222

@@ -49,7 +49,7 @@ def force_init_on_cpu():
4949
return _force_init_on_cpu_
5050

5151

52-
@contextmanager
52+
@signature_safe_contextmanager
5353
def init_on_cpu():
5454
"""
5555
Force the variable to be inited on CPU.

python/paddle/fluid/layers/control_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from __future__ import print_function
16-
from ..wrapped_decorator import contextmanager
16+
from ..wrapped_decorator import signature_safe_contextmanager
1717

1818
from .layer_function_generator import autodoc, templatedoc
1919
from .tensor import assign, fill_constant
@@ -1532,7 +1532,7 @@ def static_input(self, x):
15321532
outputs={'Out': [x_reordered]})
15331533
return shrink_memory(x_reordered, self.step_idx, self.lod_rank_table)
15341534

1535-
@contextmanager
1535+
@signature_safe_contextmanager
15361536
def block(self):
15371537
"""
15381538
The block for user to define operators in RNN. See the class docstring

python/paddle/fluid/layers/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from __future__ import print_function
16-
from ..wrapped_decorator import contextmanager
16+
from ..wrapped_decorator import signature_safe_contextmanager
1717
import multiprocessing
1818
import os
1919
import six
@@ -1116,7 +1116,7 @@ def __init__(self, reader, name=None):
11161116
def _is_completed(self):
11171117
return self.sub_block and self.source_var_names and self.sink_var_names
11181118

1119-
@contextmanager
1119+
@signature_safe_contextmanager
11201120
def block(self):
11211121
self.status = Preprocessor.IN_SUB_BLOCK
11221122
self.sub_block = self.main_prog._create_block()

python/paddle/fluid/optimizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from __future__ import print_function
1616

1717
from collections import defaultdict
18-
from .wrapped_decorator import contextmanager
18+
from .wrapped_decorator import signature_safe_contextmanager
1919

2020
from paddle.fluid.framework import Program, Variable, name_scope, default_main_program
2121
from paddle.fluid.distribute_lookup_table import find_distributed_lookup_table
@@ -1610,7 +1610,7 @@ def _append_average_accumulate_op(self, param):
16101610
},
16111611
stop_gradient=True)
16121612

1613-
@contextmanager
1613+
@signature_safe_contextmanager
16141614
def apply(self, executor, need_restore=True):
16151615
"""Apply average values to parameters of current model.
16161616
"""

0 commit comments

Comments
 (0)