From 36d3c2ac585713c198ade3af99943cd284e2eaba Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 19 Sep 2022 11:38:49 +0800 Subject: [PATCH] docs(mge/tensor): add dtype and device doc ref for typehint result GitOrigin-RevId: a9adb93889286c54cd8f9acfecc4b2ee2cb56941 --- imperative/python/megengine/tensor.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/imperative/python/megengine/tensor.py b/imperative/python/megengine/tensor.py index 2e8a1ed8..d3fd96f1 100644 --- a/imperative/python/megengine/tensor.py +++ b/imperative/python/megengine/tensor.py @@ -111,13 +111,19 @@ class Tensor(_Tensor, ArrayMethodMixin): return super().shape @property - def device(self) -> CompNode: - r"""Returns a string represents the device a :class:`~.Tensor` storaged on.""" + def device(self): + r"""Returns a string represents the device a :class:`~.Tensor` storaged on. + + .. seealso:: see :ref:`tensor-device` for more details. + """ return super().device @property def dtype(self) -> np.dtype: - r"""Returns a :class:`numpy.dtype` object represents the data type of a :class:`~.Tensor`.""" + r"""Returns a :class:`numpy.dtype` object represents the data type of a :class:`~.Tensor`. + + .. seealso:: see :ref:`tensor-dtype` for more details. + """ return super().dtype @property