Browse Source

feat(mge): do not export F.nn.nms

GitOrigin-RevId: 7a0a328c37
release-1.1
Megvii Engine Team 4 years ago
parent
commit
9c5611345f
2 changed files with 2 additions and 3 deletions
  1. +1
    -2
      imperative/python/megengine/functional/nn.py
  2. +1
    -1
      imperative/python/test/unit/functional/test_functional.py

+ 1
- 2
imperative/python/megengine/functional/nn.py View File

@@ -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:


+ 1
- 1
imperative/python/test/unit/functional/test_functional.py View File

@@ -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))




Loading…
Cancel
Save