megengine.functional.nn.conv2d¶
- conv2d(inp, weight, bias=None, stride=1, padding=0, dilation=1, groups=1, conv_mode='cross_correlation', compute_mode='default')[源代码]¶
二维卷积运算。
更多信息参见
Conv2d
.- 参数
inp (
Tensor
) – 卷积运算的特征图。weight (
Tensor
) – 卷积核。padding (
Union
[int
,Tuple
[int
,int
]]) – 输入数据空域维度两侧的填充(padding)大小。仅支持填充0值。默认:0dilation (
Union
[int
,Tuple
[int
,int
]]) – 二维卷积运算的空洞(dilation)。默认:1groups (
int
) – 在进行“分组卷积”时,对输入输出通道的分组数量。当groups
不是 1 时,in_channels
和out_channels
必须可被groups
整除,卷积核权重的形状将会是(groups, out_channel // groups, in_channels // groups, kernel_size)
。默认值:1conv_mode – supports “cross_correlation”. Default: “cross_correlation”
compute_mode – when set to “default”, no special requirements will be placed on the precision of intermediate results. When set to “float32”, “float32” would be used for accumulator and intermediate result, but only effective when input and output are of float16 dtype.
- 返回类型
- 返回
输出张量。