File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
python/paddle/fluid/layers Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3990,15 +3990,16 @@ def _is_list_or_turple_(data):
3990
3990
return out
3991
3991
3992
3992
3993
- def random_crop (input , shape , seed = 0 ):
3993
+ def random_crop (input , shape , seed = 1 ):
3994
3994
helper = LayerHelper ("random_crop" , ** locals ())
3995
3995
dtype = helper .input_dtype ()
3996
3996
out = helper .create_tmp_variable (dtype )
3997
3997
if isinstance (seed , int ):
3998
+ seed_value = seed
3998
3999
seed = helper .create_global_variable (
3999
4000
persistable = True , shape = [1 ], dtype = "int32" )
4000
4001
helper .set_variable_initializer (
4001
- var = seed , initializer = Constant (value = seed ))
4002
+ var = seed , initializer = Constant (value = seed_value ))
4002
4003
elif not isinstance (seed , Variable ):
4003
4004
raise ValueError ("'seed' must be a Variable or an int." )
4004
4005
seed_out = helper .create_tmp_variable (dtype = "int32" )
You can’t perform that action at this time.
0 commit comments