diff --git a/ppdet/modeling/layers.py b/ppdet/modeling/layers.py index 713880b9a4c3051898be6854bb077416e8c946dc..1176377457b38e158b6a30026adcca6eb0a66dc2 100644 --- a/ppdet/modeling/layers.py +++ b/ppdet/modeling/layers.py @@ -279,7 +279,7 @@ class DropBlock(nn.Layer): for s in shape: gamma *= s / (s - self.block_size + 1) - matrix = paddle.cast(paddle.rand(x.shape, x.dtype) < gamma, x.dtype) + matrix = paddle.cast(paddle.rand(x.shape) < gamma, x.dtype) mask_inv = F.max_pool2d( matrix, self.block_size,