From 5d32db8a101dd5d3a2c07a1d6d80cdf01159f736 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 27 Apr 2020 14:38:56 +0800 Subject: [PATCH] docs(mge/functional): fix docs error and refine description GitOrigin-RevId: 62da6f0d60d13f38c3b7364293a28afbe916ced2 --- python_module/megengine/functional/elemwise.py | 4 ++++ python_module/megengine/functional/nn.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python_module/megengine/functional/elemwise.py b/python_module/megengine/functional/elemwise.py index 2bb59255a..89afa1789 100644 --- a/python_module/megengine/functional/elemwise.py +++ b/python_module/megengine/functional/elemwise.py @@ -257,6 +257,7 @@ def isnan(inp: Tensor) -> Tensor: Examples: .. testcode:: + from megengine import tensor import megengine.functional as F @@ -265,6 +266,7 @@ def isnan(inp: Tensor) -> Tensor: print(F.isnan(x)) .. testoutput:: + Tensor([0 1 0], dtype=uint8) """ @@ -280,6 +282,7 @@ def isinf(inp: Tensor) -> Tensor: Examples: .. testcode:: + from megengine import tensor import megengine.functional as F @@ -288,6 +291,7 @@ def isinf(inp: Tensor) -> Tensor: print(F.isinf(x)) .. testoutput:: + Tensor([0 1 0], dtype=uint8) """ diff --git a/python_module/megengine/functional/nn.py b/python_module/megengine/functional/nn.py index 35911a386..b7a8140f9 100644 --- a/python_module/megengine/functional/nn.py +++ b/python_module/megengine/functional/nn.py @@ -546,7 +546,7 @@ def eye( comp_graph: Optional[CompGraph] = None ) -> Tensor: """ - Fills the 2-dimensional input :class:`SymbolVar` with the identity matrix. + Returns a 2D tensor with ones on the diagonal and zeros elsewhere. :param n: The number of rows :param m: The number of columns. Default: None -- GitLab