diff --git a/python_module/megengine/functional/elemwise.py b/python_module/megengine/functional/elemwise.py index 2bb59255..89afa178 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 35911a38..b7a8140f 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