Skip to content

Commit 4d9d5ff

Browse files
fix doctest for ChamferLoss
1 parent a4b7041 commit 4d9d5ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ppsci/loss/chamfer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ class ChamferLoss(base.Loss):
4040
Examples:
4141
>>> import paddle
4242
>>> from ppsci.loss import ChamferLoss
43-
>>> output_dict = {"s1": paddle.randn([1000, 3])}
44-
>>> label_dict = {"s1": paddle.randn([1000, 3])}
43+
>>> output_dict = {"s1": paddle.to_tensor([[.1, .2, .3], [.4, .5, .6]])}
44+
>>> label_dict = {"s1": paddle.to_tensor([[.4, .5, .6], [.1, .2, .3]])}
4545
>>> weight = {"s1": 0.8}
4646
>>> loss = ChamferLoss(weight=weight)
4747
>>> result = loss(output_dict, label_dict)
4848
>>> print(result)
4949
Tensor(shape=[], dtype=float32, place=Place(gpu:0), stop_gradient=True,
50-
0.14066719)
50+
0.)
5151
"""
5252

5353
def __init__(

0 commit comments

Comments
 (0)