Browse Source

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

GitOrigin-RevId: 8a07dd1da4
release-1.1
Megvii Engine Team 4 years ago
parent
commit
5b7ae26849
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

@@ -45,7 +45,6 @@ __all__ = [
"max_pool2d", "max_pool2d",
"one_hot", "one_hot",
"prelu", "prelu",
"roi_pooling",
"softmax", "softmax",
"softplus", "softplus",
"svd", "svd",
@@ -1324,7 +1323,7 @@ def roi_pooling(
np.random.seed(42) np.random.seed(42)
inp = tensor(np.random.randn(1, 1, 128, 128)) inp = tensor(np.random.randn(1, 1, 128, 128))
rois = tensor(np.random.random((4, 5))) rois = tensor(np.random.random((4, 5)))
y = F.roi_pooling(inp, rois, (2, 2))
y = F.nn.roi_pooling(inp, rois, (2, 2))
print(y.numpy()[0]) print(y.numpy()[0])


Outputs: Outputs:


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

@@ -193,7 +193,7 @@ def test_roi_pooling():
inp_feat, rois = _gen_roi_inp() inp_feat, rois = _gen_roi_inp()
grad = Grad().wrt(inp_feat, callback=_save_to(inp_feat)) grad = Grad().wrt(inp_feat, callback=_save_to(inp_feat))
output_shape = (7, 7) output_shape = (7, 7)
out_feat = F.roi_pooling(
out_feat = F.nn.roi_pooling(
inp_feat, rois, output_shape=output_shape, mode="max", scale=1.0 / 4, inp_feat, rois, output_shape=output_shape, mode="max", scale=1.0 / 4,
) )
assert make_shape_tuple(out_feat.shape) == ( assert make_shape_tuple(out_feat.shape) == (


Loading…
Cancel
Save