diff --git a/imperative/python/megengine/functional/nn.py b/imperative/python/megengine/functional/nn.py index ae03fb5b73d325f8482b2c21af9deb2428e8d362..13dee313e33d148d5671782051fec9c1519569d0 100644 --- a/imperative/python/megengine/functional/nn.py +++ b/imperative/python/megengine/functional/nn.py @@ -43,7 +43,6 @@ __all__ = [ "logsoftmax", "matmul", "max_pool2d", - "nms", "one_hot", "prelu", "roi_align", @@ -1482,7 +1481,7 @@ def nms(boxes: Tensor, scores: Tensor, iou_thresh: float) -> Tensor: x[:,2:] = np.random.rand(100,2)*20 + 100 scores = tensor(np.random.rand(100)) inp = tensor(x) - result = F.nms(inp, scores, iou_thresh=0.7) + result = F.nn.nms(inp, scores, iou_thresh=0.7) print(result.numpy()) Outputs: diff --git a/imperative/python/test/unit/functional/test_functional.py b/imperative/python/test/unit/functional/test_functional.py index 764c5c9d037a43c655e494d2dca0306bd60d03a2..15771e0b21e9c18364d101b404d03bd989b8b1f3 100644 --- a/imperative/python/test/unit/functional/test_functional.py +++ b/imperative/python/test/unit/functional/test_functional.py @@ -357,7 +357,7 @@ def test_nms(): ) inp = tensor(x) scores = tensor([0.5, 0.8, 0.9, 0.6], dtype=np.float32) - result = F.nms(inp, scores=scores, iou_thresh=0.5) + result = F.nn.nms(inp, scores=scores, iou_thresh=0.5) np.testing.assert_equal(result.numpy(), np.array([2, 1, 3], dtype=np.int32))