fix bug when iterate in locals_var.items() in python3 (#17948)

test=develop
dependabot/pip/python/requests-2.20.0
SunGaofeng 6 years ago committed by GitHub
parent 9f519bafe7
commit 3559e5a3fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -89,7 +89,7 @@ def uniform_random(shape, dtype='float32', min=-1.0, max=1.0, seed=0):
if not isinstance(dtype, core.VarDesc.VarType):
dtype = convert_np_dtype_to_dtype_(dtype)
locals_var = locals()
locals_var = locals().copy()
kwargs = dict()
for name, val in locals_var.items():
if val is not None:
@ -103,7 +103,7 @@ _hard_shrink_ = generate_layer_fn('hard_shrink')
def hard_shrink(x, threshold=None):
locals_var = locals()
locals_var = locals().copy()
kwargs = dict()
for name, val in locals_var.items():
if val is not None:
@ -124,7 +124,7 @@ _cum_sum_ = generate_layer_fn('cumsum')
def cumsum(x, axis=None, exclusive=None, reverse=None):
locals_var = locals()
locals_var = locals().copy()
kwargs = dict()
for name, val in locals_var.items():
if val is not None:
@ -145,7 +145,7 @@ _thresholded_relu_ = generate_layer_fn('thresholded_relu')
def thresholded_relu(x, threshold=None):
locals_var = locals()
locals_var = locals().copy()
kwargs = dict()
for name, val in locals_var.items():
if val is not None:

Loading…
Cancel
Save