torch_npu.contrib.npu_giou(boxes1,boxes2,is_permuted=True)
仅trans=True(仅支持xywh,不支持xyxy), is_cross=False(仅支持boxes1.shape ==boxes2.shape,不支持((n,4), (m,4)))
>>> box1 = torch.randn(32, 4) >>> box1.requires_grad = True >>> box2 = torch.randn(32, 4) >>> iou1 = npu_giou(box1, box2) # (32, 1) >>> l = iou1.sum() >>> l.backward()