:param padding: size of the paddings added to the input on both sides of its
:param padding: size of the paddings added to the input on both sides of its
spatial dimensions. Only zero-padding is supported. Default: 0
spatial dimensions. Only zero-padding is supported. Default: 0
:param dilation: dilation of the 2D convolution operation. Default: 1
:param dilation: dilation of the 2D convolution operation. Default: 1
:param groups: number of groups into which the input and output channels are divided, so as to perform a ``grouped convolution``. When ``groups`` is not 1,
:param groups: number of groups into which the input and output channels are divided,
so as to perform a ``grouped convolution``. When ``groups`` is not 1,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
and the shape of weight should be `(groups, out_channel // groups,
and the shape of weight should be `(groups, out_channel // groups,
in_channels // groups, height, width)`.
in_channels // groups, height, width)`.
...
@@ -141,7 +144,6 @@ def conv2d(
...
@@ -141,7 +144,6 @@ def conv2d(
pad_h,pad_w=expand_hw(padding)
pad_h,pad_w=expand_hw(padding)
dilate_h,dilate_w=expand_hw(dilation)
dilate_h,dilate_w=expand_hw(dilation)
Sparse=builtin.Convolution.Sparse
sparse_type="DENSE"ifgroups==1else"GROUP"
sparse_type="DENSE"ifgroups==1else"GROUP"
op=builtin.Convolution(
op=builtin.Convolution(
stride_h=stride_h,
stride_h=stride_h,
...
@@ -185,7 +187,8 @@ def conv_transpose2d(
...
@@ -185,7 +187,8 @@ def conv_transpose2d(
:param padding: size of the paddings added to the input on both sides of its
:param padding: size of the paddings added to the input on both sides of its
spatial dimensions. Only zero-padding is supported. Default: 0
spatial dimensions. Only zero-padding is supported. Default: 0
:param dilation: dilation of the 2D convolution operation. Default: 1
:param dilation: dilation of the 2D convolution operation. Default: 1
:param groups: number of groups into which the input and output channels are divided, so as to perform a ``grouped convolution``. When ``groups`` is not 1,
:param groups: number of groups into which the input and output channels are divided,
so as to perform a ``grouped convolution``. When ``groups`` is not 1,
``in_channels`` and ``out_channels`` must be divisible by groups,
``in_channels`` and ``out_channels`` must be divisible by groups,
and the shape of weight should be `(groups, out_channel // groups,
and the shape of weight should be `(groups, out_channel // groups,
:param padding: size of the paddings added to the input on both sides of its
:param padding: size of the paddings added to the input on both sides of its
spatial dimensions. Only zero-padding is supported. Default: 0
spatial dimensions. Only zero-padding is supported. Default: 0
:param dilation: dilation of the 1D convolution operation. Default: 1
:param dilation: dilation of the 1D convolution operation. Default: 1
:param groups: number of groups into which the input and output channels are divided, so as to perform a "grouped convolution". When ``groups`` is not 1,
:param groups: number of groups into which the input and output channels are divided,
so as to perform a "grouped convolution". When ``groups`` is not 1,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
and there would be an extra dimension at the beginning of the weight's
and there would be an extra dimension at the beginning of the weight's
shape. Specifically, the shape of weight would be `(groups,
shape. Specifically, the shape of weight would be `(groups,
...
@@ -250,15 +258,16 @@ class Conv2d(_ConvNd):
...
@@ -250,15 +258,16 @@ class Conv2d(_ConvNd):
In general, output feature maps' shapes can be inferred as follows:
In general, output feature maps' shapes can be inferred as follows:
When `groups == in_channels` and `out_channels == K * in_channels`,
When `groups == in_channels` and `out_channels == K * in_channels`,
where K is a positive integer, this operation is also known as depthwise
where K is a positive integer, this operation is also known as depthwise
...
@@ -277,7 +286,8 @@ class Conv2d(_ConvNd):
...
@@ -277,7 +286,8 @@ class Conv2d(_ConvNd):
:param padding: size of the paddings added to the input on both sides of its
:param padding: size of the paddings added to the input on both sides of its
spatial dimensions. Only zero-padding is supported. Default: 0
spatial dimensions. Only zero-padding is supported. Default: 0
:param dilation: dilation of the 2D convolution operation. Default: 1
:param dilation: dilation of the 2D convolution operation. Default: 1
:param groups: number of groups into which the input and output channels are divided, so as to perform a "grouped convolution". When ``groups`` is not 1,
:param groups: number of groups into which the input and output channels are divided,
so as to perform a "grouped convolution". When ``groups`` is not 1,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
and there would be an extra dimension at the beginning of the weight's
and there would be an extra dimension at the beginning of the weight's
shape. Specifically, the shape of weight would be `(groups,
shape. Specifically, the shape of weight would be `(groups,
...
@@ -406,7 +416,8 @@ class ConvTranspose2d(_ConvNd):
...
@@ -406,7 +416,8 @@ class ConvTranspose2d(_ConvNd):
:param padding: size of the paddings added to the input on both sides of its
:param padding: size of the paddings added to the input on both sides of its
spatial dimensions. Only zero-padding is supported. Default: 0
spatial dimensions. Only zero-padding is supported. Default: 0
:param dilation: dilation of the 2D convolution operation. Default: 1
:param dilation: dilation of the 2D convolution operation. Default: 1
:param groups: number of groups into which the input and output channels are divided, so as to perform a "grouped convolution". When ``groups`` is not 1,
:param groups: number of groups into which the input and output channels are divided,
so as to perform a "grouped convolution". When ``groups`` is not 1,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
``in_channels`` and ``out_channels`` must be divisible by ``groups``,
and there would be an extra dimension at the beginning of the weight's
and there would be an extra dimension at the beginning of the weight's
shape. Specifically, the shape of weight would be ``(groups,
shape. Specifically, the shape of weight would be ``(groups,