Skip to content

Commit cd8f562

Browse files
committed
fix comment
1 parent 3786847 commit cd8f562

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

torch/nn/modules/conv.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def __init__(self, in_channels, out_channels, kernel_size, stride,
4141
self.output_padding = output_padding
4242
self.groups = groups
4343
self.padding_mode = padding_mode
44+
# `_reversed_padding_repeated_twice` is the padding to be passed to
45+
# `F.pad` if needed (e.g., for non-zero padding types that are
46+
# implemented as two ops: padding + conv). `F.pad` accepts paddings in
47+
# reverse order than the dimension.
4448
self._reversed_padding_repeated_twice = _reverse_repeat_tuple(self.padding, 2)
4549
if transposed:
4650
self.weight = Parameter(torch.Tensor(

torch/testing/_internal/common_nn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3252,7 +3252,7 @@ def fractional_max_pool3d_test(test_case):
32523252
padding = tuple(range(1, d + 1))
32533253
cpp_padding = '{' + ', '.join(map(str, padding)) + '}'
32543254
input_size = (2, 2) + (4,) * d
3255-
output_size = (2, 3) + tuple(p + 1 for p in padding) # simplified from `(3 + 2 * p - 3) // 2`
3255+
output_size = (2, 3) + tuple(p + 1 for p in padding) # simplified from `(4 + 2 * p - 3) // 2 + 1`
32563256
new_module_tests.append(
32573257
dict(
32583258
module_name='Conv{}d'.format(d),

0 commit comments

Comments
 (0)