diff --git a/python/paddle/fluid/tests/unittests/test_layers.py b/python/paddle/fluid/tests/unittests/test_layers.py index 6c5864cfebc93c115f07bf9c0bef5987ca4d50e8..676f35838ad3369e9c434a8598dbd2eaf32eaf17 100644 --- a/python/paddle/fluid/tests/unittests/test_layers.py +++ b/python/paddle/fluid/tests/unittests/test_layers.py @@ -3661,9 +3661,7 @@ class TestBook(LayerTest): shape=[1], dtype='float32', append_batch_size=False) - _scale = scale_var.numpy().item(0) if isinstance( - scale_var, core.eager.Tensor) else scale_var - out = layers.scale(input, scale=_scale) + out = layers.scale(input, scale=scale_var) return out def make_softshrink(self):