Browse Source

docs(mge): refactor docs to remove warnings

GitOrigin-RevId: efefc2a4a2
release-1.5
Megvii Engine Team huangxinda 3 years ago
parent
commit
f40df60242
3 changed files with 27 additions and 24 deletions
  1. +3
    -3
      imperative/python/megengine/functional/debug_param.py
  2. +23
    -20
      imperative/python/megengine/module/conv.py
  3. +1
    -1
      imperative/python/megengine/module/pooling.py

+ 3
- 3
imperative/python/megengine/functional/debug_param.py View File

@@ -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.


+ 23
- 20
imperative/python/megengine/module/conv.py View File

@@ -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__(


+ 1
- 1
imperative/python/megengine/module/pooling.py View File

@@ -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:


Loading…
Cancel
Save