Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
7ac693a8
MegEngine
项目概览
MegEngine 天元
/
MegEngine
大约 1 年 前同步成功
通知
399
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7ac693a8
编写于
11月 25, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs(imperative): fix multiple target warning when cross-reference
GitOrigin-RevId: c5b4884c8ab98e5986ce8e9006c841df9149fb6f
上级
e65e3f05
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
19 addition
and
19 deletion
+19
-19
imperative/python/megengine/functional/nn.py
imperative/python/megengine/functional/nn.py
+4
-4
imperative/python/megengine/module/dropout.py
imperative/python/megengine/module/dropout.py
+1
-1
imperative/python/megengine/module/qat/concat.py
imperative/python/megengine/module/qat/concat.py
+1
-1
imperative/python/megengine/module/qat/conv.py
imperative/python/megengine/module/qat/conv.py
+3
-3
imperative/python/megengine/module/qat/conv_bn.py
imperative/python/megengine/module/qat/conv_bn.py
+2
-2
imperative/python/megengine/module/qat/elemwise.py
imperative/python/megengine/module/qat/elemwise.py
+1
-1
imperative/python/megengine/module/qat/linear.py
imperative/python/megengine/module/qat/linear.py
+1
-1
imperative/python/megengine/quantization/qconfig.py
imperative/python/megengine/quantization/qconfig.py
+1
-1
imperative/python/megengine/utils/network.py
imperative/python/megengine/utils/network.py
+5
-5
未找到文件。
imperative/python/megengine/functional/nn.py
浏览文件 @
7ac693a8
...
...
@@ -367,7 +367,7 @@ def conv_transpose2d(
)
->
Tensor
:
r
"""2D transposed convolution operation.
Refer to :class:`~.ConvTranspose2d` for more information.
Refer to :class:`~.
module.conv.
ConvTranspose2d` for more information.
Args:
inp: feature map of the convolution operation.
...
...
@@ -1519,7 +1519,7 @@ def dropout(inp: Tensor, drop_prob: float, training: bool = True) -> Tensor:
inp: input tensor.
drop_prob: probability to drop (set to zero) a single element.
training: the default behavior of ``dropout`` during training is to rescale the output,
then it can be replaced by an :class:`~.Identity` during inference. Default: True
then it can be replaced by an :class:`~.
module.identify.
Identity` during inference. Default: True
Returns:
the ouput tensor
...
...
@@ -1669,7 +1669,7 @@ def sliding_window(
)
->
Tensor
:
r
"""Extracts sliding local blocks from a batched input tensor.
Refer to :class:`~.SlidingWindow` for more information.
Refer to :class:`~.
module.sliding_window.
SlidingWindow` for more information.
Args:
inp: input tensor.
...
...
@@ -1707,7 +1707,7 @@ def sliding_window_transpose(
)
->
Tensor
:
r
"""Sum over the sliding windows on the corresponding input location.
Refer to :class:`~.SlidingWindowTranspose` for more information.
Refer to :class:`~.
module.sliding_window.
SlidingWindowTranspose` for more information.
Args:
inp: input tensor.
...
...
imperative/python/megengine/module/dropout.py
浏览文件 @
7ac693a8
...
...
@@ -14,7 +14,7 @@ class Dropout(Module):
r
"""Randomly sets input elements to zeros with the probability :math:`drop\_prob` during training.
Commonly used in large networks to prevent overfitting.
Note that we perform dropout only during training, we also rescale(multiply) the output tensor
by :math:`\frac{1}{1 - drop\_prob}`. During inference :class:`~.Dropout` is equal to :class:`~.Identity`.
by :math:`\frac{1}{1 - drop\_prob}`. During inference :class:`~.Dropout` is equal to :class:`~.
module.identity.
Identity`.
Args:
drop_prob: The probability to drop (set to zero) each single element
...
...
imperative/python/megengine/module/qat/concat.py
浏览文件 @
7ac693a8
...
...
@@ -14,7 +14,7 @@ from .module import QATModule
class
Concat
(
Float
.
Concat
,
QATModule
):
r
"""A :class:`~.QATModule` to do functional :func:`~.concat` with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
def
forward
(
self
,
inps
:
Iterable
[
Tensor
],
axis
:
int
=
0
):
...
...
imperative/python/megengine/module/qat/conv.py
浏览文件 @
7ac693a8
...
...
@@ -12,7 +12,7 @@ from .module import QATModule
class
Conv2d
(
Float
.
Conv2d
,
QATModule
):
r
"""A :class:`~.QATModule` :class:`~.module.Conv2d` with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
def
calc_conv_qat
(
self
,
inp
):
...
...
@@ -50,7 +50,7 @@ class Conv2d(Float.Conv2d, QATModule):
class
ConvRelu2d
(
Conv2d
):
r
"""A :class:`~.QATModule` include :class:`~.module.Conv2d` and :func:`~.relu` with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
def
forward
(
self
,
inp
):
...
...
@@ -59,7 +59,7 @@ class ConvRelu2d(Conv2d):
class
ConvTranspose2d
(
Float
.
ConvTranspose2d
,
QATModule
):
r
"""A :class:`~.QATModule` :class:`~.module.ConvTranspose2d` with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
def
calc_conv_transpose2d_qat
(
self
,
inp
):
...
...
imperative/python/megengine/module/qat/conv_bn.py
浏览文件 @
7ac693a8
...
...
@@ -157,7 +157,7 @@ class _ConvBnActivation2d(Float._ConvBnActivation2d, QATModule):
class
ConvBn2d
(
_ConvBnActivation2d
):
r
"""A fused :class:`~.QATModule` including :class:`~.module.Conv2d` and :class:`~.module.BatchNorm2d` with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
def
forward
(
self
,
inp
):
...
...
@@ -166,7 +166,7 @@ class ConvBn2d(_ConvBnActivation2d):
class
ConvBnRelu2d
(
_ConvBnActivation2d
):
r
"""A fused :class:`~.QATModule` including :class:`~.module.Conv2d`, :class:`~.module.BatchNorm2d` and :func:`~.relu` with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
def
forward
(
self
,
inp
):
...
...
imperative/python/megengine/module/qat/elemwise.py
浏览文件 @
7ac693a8
...
...
@@ -11,7 +11,7 @@ from .module import QATModule
class
Elemwise
(
Float
.
Elemwise
,
QATModule
):
r
"""A :class:`~.QATModule` to do :mod:`~.functional.elemwise` operator with QAT support.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
"""
with_weight
=
False
...
...
imperative/python/megengine/module/qat/linear.py
浏览文件 @
7ac693a8
...
...
@@ -11,7 +11,7 @@ from .module import QATModule
class
Linear
(
Float
.
Linear
,
QATModule
):
r
"""A :class:`~.QATModule` version of :class:`~.module.Linear`.
Could be applied with :class:`~.Observer` and :class:`~.FakeQuantize`.
Could be applied with :class:`~.Observer` and :class:`~.
quantization.fake_quant.
FakeQuantize`.
Args:
in_features: size of each input sample.
...
...
imperative/python/megengine/quantization/qconfig.py
浏览文件 @
7ac693a8
...
...
@@ -34,7 +34,7 @@ class QConfig(
weight_observer: interface to instantiate an :class:`~.Observer` indicating
how to collect scales and zero_point of wegiht.
act_observer: similar to ``weight_observer`` but toward activation.
weight_fake_quant: interface to instantiate a :class:`~.FakeQuantize` indicating
weight_fake_quant: interface to instantiate a :class:`~.
quantization.fake_quant.
FakeQuantize` indicating
how to do fake_quant calculation.
act_observer: similar to ``weight_fake_quant`` but toward activation.
...
...
imperative/python/megengine/utils/network.py
浏览文件 @
7ac693a8
...
...
@@ -532,13 +532,13 @@ def set_symbolic_shape(option: bool):
def
as_varnode
(
obj
):
r
"""convert a :class:`.
VarNode` compatible object to :class:`
.VarNode`.
r
"""convert a :class:`.
utils.network_node.VarNode` compatible object to :class:`.utils.network_node
.VarNode`.
Args:
obj: it must be one of the following:
1. a :class:`.VarNode` object
2. a :class:`.OpNode` object that has unique output
1. a :class:`.
utils.network_node.
VarNode` object
2. a :class:`.
utils.network_node.
OpNode` object that has unique output
3. an iterable that produces either type 1 or 2, with length 1
"""
...
...
@@ -568,8 +568,8 @@ def as_varnode(obj):
def
as_oprnode
(
obj
):
r
"""convert a :class:`.OpNode` compatible object to
:class:`.
OpNode`; it works like :func:`as_varnode`.i
r
"""convert a :class:`.
utils.network_node.
OpNode` compatible object to
:class:`.
utils.network_node.OpNode`; it works like :func:`as_varnode`.
"""
if
type
(
obj
)
is
VarNode
:
return
obj
.
owner
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录