提交 3bcb67f1 编写于 作者: F fengjiayi

fix a bug

上级 a5ab2f21
...@@ -3990,15 +3990,16 @@ def upsampling_bilinear2d(input, out_shape=None, scale=None, name=None): ...@@ -3990,15 +3990,16 @@ def upsampling_bilinear2d(input, out_shape=None, scale=None, name=None):
return out return out
def random_crop(input, shape, seed=0): def random_crop(input, shape, seed=1):
helper = LayerHelper("random_crop", **locals()) helper = LayerHelper("random_crop", **locals())
dtype = helper.input_dtype() dtype = helper.input_dtype()
out = helper.create_tmp_variable(dtype) out = helper.create_tmp_variable(dtype)
if isinstance(seed, int): if isinstance(seed, int):
seed_value = seed
seed = helper.create_global_variable( seed = helper.create_global_variable(
persistable=True, shape=[1], dtype="int32") persistable=True, shape=[1], dtype="int32")
helper.set_variable_initializer( helper.set_variable_initializer(
var=seed, initializer=Constant(value=seed)) var=seed, initializer=Constant(value=seed_value))
elif not isinstance(seed, Variable): elif not isinstance(seed, Variable):
raise ValueError("'seed' must be a Variable or an int.") raise ValueError("'seed' must be a Variable or an int.")
seed_out = helper.create_tmp_variable(dtype="int32") seed_out = helper.create_tmp_variable(dtype="int32")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册