Skip to content

Commit 558516f

Browse files
iaroslav-aiezyang
authored andcommitted
More docs for Conv1d Conv2d (#3870)
* Add a bit of notation explanation For a first time user of Conv1d, it is not clear from documentation what N, C and L exactly mean. This should clarify this. Same for Conv2d.
1 parent 11c9bd6 commit 558516f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

torch/nn/modules/conv.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ class Conv1d(_ConvNd):
7878
+ \sum_{{k}=0}^{C_{in}-1} weight(C_{out_j}, k) \star input(N_i, k)
7979
\end{array}
8080
81-
where :math:`\star` is the valid `cross-correlation`_ operator
81+
where :math:`\star` is the valid `cross-correlation`_ operator,
82+
:math:`N` is a batch size, :math:`C` denotes a number of channels,
83+
:math:`L` is a length of signal sequence.
8284
8385
| :attr:`stride` controls the stride for the cross-correlation, a single
8486
number or a tuple.
@@ -181,7 +183,10 @@ class Conv2d(_ConvNd):
181183
+ \sum_{{k}=0}^{C_{in}-1} weight(C_{out_j}, k) \star input(N_i, k)
182184
\end{array}
183185
184-
where :math:`\star` is the valid 2D `cross-correlation`_ operator
186+
where :math:`\star` is the valid 2D `cross-correlation`_ operator,
187+
:math:`N` is a batch size, :math:`C` denotes a number of channels,
188+
:math:`H` is a height of input planes in pixels, and :math:`W` is
189+
width in pixels.
185190
186191
| :attr:`stride` controls the stride for the cross-correlation, a single
187192
number or a tuple.

0 commit comments

Comments
 (0)