From f40df60242d61c4ca1e0786c3ee410873f627608 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 9 Jul 2021 14:34:20 +0800 Subject: [PATCH] docs(mge): refactor docs to remove warnings GitOrigin-RevId: efefc2a4a21027600d1ac3156c648bb987d039e4 --- .../python/megengine/functional/debug_param.py | 6 +-- imperative/python/megengine/module/conv.py | 43 ++++++++++++---------- imperative/python/megengine/module/pooling.py | 2 +- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/imperative/python/megengine/functional/debug_param.py b/imperative/python/megengine/functional/debug_param.py index 7467eb73..2bdf9935 100644 --- a/imperative/python/megengine/functional/debug_param.py +++ b/imperative/python/megengine/functional/debug_param.py @@ -24,7 +24,7 @@ if os.getenv("MEGENGINE_CONV_EXECUTION_STRATEGY") != None: def get_execution_strategy() -> Strategy: """ - Returns the execution strategy of :class:`~.Conv2d` and :func:'~.matmul' + Returns the execution strategy of :class:`~module..Conv2d` and :func:`~.matmul` See :func:`~.set_execution_strategy` for possible return values """ @@ -33,9 +33,9 @@ def get_execution_strategy() -> Strategy: def set_execution_strategy(option): """ - Sets the execution strategy of :class:`~.Conv2d` and :func:'~.matmul' + Sets the execution strategy of :class:`~module.Conv2d` and :func:`~.matmul` - :param option: Decides how :class:`~.Conv2d`and :func:'~.matmul' algorithms are chosen. + :param option: Decides how :class:`~module.Conv2d`and :func:`~.matmul` algorithms are chosen. Available value Strategy * HEURISTIC uses heuristic to choose the fastest algorithm. * PROFILE runs possible algorithms on real device to find the best one. diff --git a/imperative/python/megengine/module/conv.py b/imperative/python/megengine/module/conv.py index aef97d85..c292cfc4 100644 --- a/imperative/python/megengine/module/conv.py +++ b/imperative/python/megengine/module/conv.py @@ -144,9 +144,9 @@ class Conv1d(_ConvNd): .. note:: - :attr:`weight` usually has shape ``(out_channels, in_channels, kernel_size)``, - if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, kernel_size)`` - :attr:`bias` usually has shape ``(1, out_channels, 1)`` + * ``weight`` usually has shape ``(out_channels, in_channels, kernel_size)`` , + if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, kernel_size)`` + * ``bias`` usually has shape ``(1, out_channels, 1)`` Examples: @@ -309,9 +309,9 @@ class Conv2d(_ConvNd): .. note:: - :attr:`weight` usually has shape ``(out_channels, in_channels, height, width)``, - if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, height, width)`` - :attr:`bias` usually has shape ``(1, out_channels, *1)`` + * ``weight`` usually has shape ``(out_channels, in_channels, height, width)`` , + if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, height, width)`` + * ``bias`` usually has shape ``(1, out_channels, *1)`` Examples: @@ -455,9 +455,9 @@ class Conv3d(_ConvNd): .. note:: - :attr:`weight` usually has shape ``(out_channels, in_channels, depth, height, width)``, - if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, depth, height, width)`` - :attr:`bias` usually has shape ``(1, out_channels, *1)`` + * ``weight`` usually has shape ``(out_channels, in_channels, depth, height, width)`` , + if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, depth, height, width)`` + * ``bias`` usually has shape ``(1, out_channels, *1)`` Examples: @@ -587,9 +587,10 @@ class ConvTranspose2d(_ConvNd): .. note:: - :attr:`weight` usually has shape ``(in_channels, out_channels, height, width)``, - if groups is not 1, shape will be ``(groups, in_channels // groups, out_channels // groups, height, width)`` - :attr:`bias` usually has shape ``(1, out_channels, *1)`` + * ``weight`` usually has shape ``(in_channels, out_channels, height, width)`` , + if groups is not 1, shape will be ``(groups, in_channels // groups, out_channels // groups, height, width)`` + * ``bias`` usually has shape ``(1, out_channels, *1)`` + """ def __init__( @@ -685,9 +686,10 @@ class LocalConv2d(Conv2d): .. note:: - :attr:`weight` usually has shape ``(out_height, out_width, in_channels, height, width, in_channels)``, - if groups is not 1, shape will be ``(groups, out_height, out_width, in_channels // groups, height, width, out_channels // groups)`` - :attr:`bias` usually has shape ``(1, out_channels, *1)`` + * ``weight`` usually has shape ``(out_height, out_width, in_channels, height, width, in_channels)`` , + if groups is not 1, shape will be ``(groups, out_height, out_width, in_channels // groups, height, width, out_channels // groups)`` + * ``bias`` usually has shape ``(1, out_channels, *1)`` + """ def __init__( @@ -788,9 +790,9 @@ class DeformableConv2d(_ConvNd): .. note:: - :attr:`weight` usually has shape ``(out_channels, in_channels, height, width)``, - if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, height, width)`` - :attr:`bias` usually has shape ``(1, out_channels, *1)`` + * ``weight`` usually has shape ``(out_channels, in_channels, height, width)`` , + if groups is not 1, shape will be ``(groups, out_channels // groups, in_channels // groups, height, width)`` + * ``bias`` usually has shape ``(1, out_channels, *1)`` """ @@ -898,8 +900,9 @@ class ConvTranspose3d(_ConvNd): .. note:: - :attr:`weight` usually has shape ``(in_channels, out_channels, depth, height, width)``. - :attr:`bias` usually has shape ``(1, out_channels, *1)`` + * ``weight`` usually has shape ``(in_channels, out_channels, depth, height, width)`` . + * ``bias`` usually has shape ``(1, out_channels, *1)`` + """ def __init__( diff --git a/imperative/python/megengine/module/pooling.py b/imperative/python/megengine/module/pooling.py index 5bbecf60..28d2b796 100644 --- a/imperative/python/megengine/module/pooling.py +++ b/imperative/python/megengine/module/pooling.py @@ -104,7 +104,7 @@ class AvgPool2d(_PoolNd): :param stride: the stride of the window. Default value is kernel_size。 :param padding: implicit zero padding to be added on both sides. :param mode: whether to count padding values. "average" mode will do counting and - "average_count_exclude_padding" mode won't do counting. + "average_count_exclude_padding" mode won't do counting. Default: "average_count_exclude_padding" Examples: