未验证 提交 91111226 编写于 作者: W wangxinxin08 提交者: GitHub

fix register_buffer (#5398)

上级 afb3b7a1
...@@ -763,8 +763,9 @@ def batch_distance2bbox(points, distance, max_shapes=None): ...@@ -763,8 +763,9 @@ def batch_distance2bbox(points, distance, max_shapes=None):
Tensor: Decoded bboxes, "x1y1x2y2" format. Tensor: Decoded bboxes, "x1y1x2y2" format.
""" """
lt, rb = paddle.split(distance, 2, -1) lt, rb = paddle.split(distance, 2, -1)
x1y1 = points - lt # while tensor add parameters, parameters should be better placed on the second place
x2y2 = points + rb x1y1 = -lt + points
x2y2 = rb + points
out_bbox = paddle.concat([x1y1, x2y2], -1) out_bbox = paddle.concat([x1y1, x2y2], -1)
if max_shapes is not None: if max_shapes is not None:
max_shapes = max_shapes.flip(-1).tile([1, 2]) max_shapes = max_shapes.flip(-1).tile([1, 2])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册