From 218e759b44b584e69ebc2c1b9a63982f995f6ed5 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Thu, 21 Apr 2022 22:12:39 +0800 Subject: [PATCH] [Eager] remove useless logic (#42020) (#42061) --- 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