Browse Source

docs(functional): replace megengine function testcode with doctest format

GitOrigin-RevId: f91d5f5afd
release-1.10
Megvii Engine Team 3 years ago
parent
commit
3f11b4213a
2 changed files with 0 additions and 4 deletions
  1. +0
    -2
      imperative/python/megengine/functional/nn.py
  2. +0
    -2
      imperative/python/megengine/module/lrn.py

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

@@ -1850,8 +1850,6 @@ def local_response_norm(
... [19.420258, 20.331186, 21.233786, 22.127764, 23.012836 ]]]])
>>> out = F.local_response_norm(inp, kernel_size=3, k=1.0, alpha=1e-4, beta=0.75)
>>> np.testing.assert_allclose(GT, out.numpy(), rtol=1e-6, atol=1e-6)
>>> print('pass')
pass
"""
op = builtin.LRN(n=kernel_size, k=k, alpha=alpha, beta=beta,)
(output,) = apply(op, inp)


+ 0
- 2
imperative/python/megengine/module/lrn.py View File

@@ -33,8 +33,6 @@ class LocalResponseNorm(Module):
>>> op = M.LocalResponseNorm(kernel_size=3, k=1.0, alpha=1e-4, beta=0.75)
>>> out = op(inp)
>>> np.testing.assert_allclose(GT, out.numpy(), rtol=1e-6, atol=1e-6)
>>> print('pass')
pass
"""

def __init__(


Loading…
Cancel
Save