From 8796586b8935197913896ad71edcbe1ef61a76f7 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 13 Sep 2021 20:03:32 +0800 Subject: [PATCH] refactor(functional): import all from metric in nn GitOrigin-RevId: 41ab78d78d712f65cb75b6eb686e1de00a23f318 --- imperative/python/megengine/functional/metric.py | 4 ++++ imperative/python/megengine/functional/nn.py | 1 + 2 files changed, 5 insertions(+) diff --git a/imperative/python/megengine/functional/metric.py b/imperative/python/megengine/functional/metric.py index 77dd63af1..ee010a11f 100644 --- a/imperative/python/megengine/functional/metric.py +++ b/imperative/python/megengine/functional/metric.py @@ -15,6 +15,10 @@ from .elemwise import abs, maximum, minimum from .math import topk as _topk from .tensor import broadcast_to, transpose +__all__ = [ + "topk_accuracy", +] + def topk_accuracy( logits: Tensor, target: Tensor, topk: Union[int, Iterable[int]] = 1 diff --git a/imperative/python/megengine/functional/nn.py b/imperative/python/megengine/functional/nn.py index 305c30f7e..568df43fb 100644 --- a/imperative/python/megengine/functional/nn.py +++ b/imperative/python/megengine/functional/nn.py @@ -1660,3 +1660,4 @@ warp_perspective = deprecated_func( ) from .quantized import conv_bias_activation # isort:skip from .loss import * # isort:skip +from .metric import * # isort:skip -- GitLab