Skip to content

Commit 3bcb67f

Browse files
committed
fix a bug
1 parent a5ab2f2 commit 3bcb67f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3990,15 +3990,16 @@ def _is_list_or_turple_(data):
39903990
return out
39913991

39923992

3993-
def random_crop(input, shape, seed=0):
3993+
def random_crop(input, shape, seed=1):
39943994
helper = LayerHelper("random_crop", **locals())
39953995
dtype = helper.input_dtype()
39963996
out = helper.create_tmp_variable(dtype)
39973997
if isinstance(seed, int):
3998+
seed_value = seed
39983999
seed = helper.create_global_variable(
39994000
persistable=True, shape=[1], dtype="int32")
40004001
helper.set_variable_initializer(
4001-
var=seed, initializer=Constant(value=seed))
4002+
var=seed, initializer=Constant(value=seed_value))
40024003
elif not isinstance(seed, Variable):
40034004
raise ValueError("'seed' must be a Variable or an int.")
40044005
seed_out = helper.create_tmp_variable(dtype="int32")

tools/codestyle/docstring_checker.pyc

11.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)