Skip to content

Commit 4477d6d

Browse files
committed
update UT for KL label_smooth
1 parent 5d54480 commit 4477d6d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/paddle/fluid/tests/unittests/xpu/test_label_smooth_op_xpu.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
paddle.enable_static()
2525

2626

27-
@unittest.skipIf(not paddle.is_compiled_with_xpu(),
28-
"core is not compiled with XPU")
2927
class TestLabelSmoothOp(XPUOpTest):
3028
def config(self):
3129
self.op_type = "label_smooth"
@@ -45,14 +43,14 @@ def setUp(self):
4543
self.outputs = {'Out': smoothed_label}
4644

4745
def test_check_output(self):
46+
if not paddle.is_compiled_with_xpu():
47+
return
4848
self.check_output_with_place(paddle.XPUPlace(0), atol=1e-6)
4949

5050
def test_check_grad(self):
5151
return
5252

5353

54-
@unittest.skipIf(not paddle.is_compiled_with_xpu(),
55-
"core is not compiled with XPU")
5654
class TestLabelSmoothOp3D(TestLabelSmoothOp):
5755
def setUp(self):
5856
super(TestLabelSmoothOp3D, self).setUp()

0 commit comments

Comments
 (0)