From e64760fe2bd5330be6c6b3b26bf6d6723440f7ae Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Sat, 10 Oct 2020 19:48:29 +0800 Subject: [PATCH] docs(mge): warp_perspective, gather & scatter GitOrigin-RevId: f2436e850177b061c6bf7376d3f5b786baa6143c --- imperative/python/megengine/functional/nn.py | 4 ++++ imperative/python/megengine/functional/tensor.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/imperative/python/megengine/functional/nn.py b/imperative/python/megengine/functional/nn.py index d146ce67..55037d8d 100644 --- a/imperative/python/megengine/functional/nn.py +++ b/imperative/python/megengine/functional/nn.py @@ -884,6 +884,10 @@ def warp_perspective( :param interp_mode: interpolation methods. Default: "LINEAR" :return: output tensor. + Note: + + The transformation matrix is the inverse of that used by `cv2.warpPerspective`. + Examples: .. testcode:: diff --git a/imperative/python/megengine/functional/tensor.py b/imperative/python/megengine/functional/tensor.py index ada53ead..0b30d798 100644 --- a/imperative/python/megengine/functional/tensor.py +++ b/imperative/python/megengine/functional/tensor.py @@ -391,6 +391,7 @@ def _get_idx(index, axis): def gather(inp: Tensor, axis: int, index: Tensor) -> Tensor: + # TODO: rewrite doc r"""Gathers data from input tensor on axis using index. For a 3-D tensor, the output is specified by:: @@ -462,6 +463,7 @@ def gather(inp: Tensor, axis: int, index: Tensor) -> Tensor: def scatter(inp: Tensor, axis: int, index: Tensor, source: Tensor) -> Tensor: + # TODO: rewrite doc r"""Writes all values from the tensor source into input tensor at the indices specified in the index tensor.