提交 16bf7fc7 编写于 作者: W WuHaobo

support for paddle1.8

上级 a55f8266
...@@ -192,8 +192,9 @@ class EfficientNet(): ...@@ -192,8 +192,9 @@ class EfficientNet():
if is_test: if is_test:
return inputs return inputs
keep_prob = 1.0 - prob keep_prob = 1.0 - prob
random_tensor = keep_prob + fluid.layers.uniform_random_batch_size_like( inputs_shape = fluid.layers.shape(inputs)
inputs, [-1, 1, 1, 1], min=0., max=1.) random_tensor = keep_prob + fluid.layers.uniform_random(
shape=[inputs_shape[0], 1, 1, 1], min=0., max=1.)
binary_tensor = fluid.layers.floor(random_tensor) binary_tensor = fluid.layers.floor(random_tensor)
output = inputs / keep_prob * binary_tensor output = inputs / keep_prob * binary_tensor
return output return output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册