From 233b36417573cb76ed0d82f5015fb73e12a938bb Mon Sep 17 00:00:00 2001 From: LokeZhou Date: Wed, 2 Nov 2022 18:46:12 +0800 Subject: [PATCH] Support 0 dimension tensor modification (#7250) --- ppdet/modeling/tests/test_yolov3_loss.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ppdet/modeling/tests/test_yolov3_loss.py b/ppdet/modeling/tests/test_yolov3_loss.py index 433b3cf2c..e3c1c403b 100644 --- a/ppdet/modeling/tests/test_yolov3_loss.py +++ b/ppdet/modeling/tests/test_yolov3_loss.py @@ -356,10 +356,7 @@ class TestYolov3LossOp(unittest.TestCase): x, t, gtbox, anchor, self.downsample_ratio, self.scale_x_y) for k in yolo_loss2: self.assertAlmostEqual( - yolo_loss1[k].numpy()[0], - yolo_loss2[k].numpy()[0], - delta=1e-2, - msg=k) + float(yolo_loss1[k]), float(yolo_loss2[k]), delta=1e-2, msg=k) class TestYolov3LossNoGTScore(TestYolov3LossOp): -- GitLab