From d67abac6851255f3664a080972dcab78462c482e Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Wed, 20 Apr 2022 19:10:10 +0800 Subject: [PATCH] [Eager] remove useless logic (#42020) --- python/paddle/fluid/tests/unittests/test_layers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_layers.py b/python/paddle/fluid/tests/unittests/test_layers.py index 6c5864cfebc..676f35838ad 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): -- GitLab