Skip to content

Commit d48afd4

Browse files
DmitryUlyanovapaszke
authored andcommitted
Add print string for MaxPool3d, change for MaxPool2d (pytorch#1115)
1 parent e21e4bf commit d48afd4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

torch/nn/modules/pooling.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,14 @@ def forward(self, input):
549549
self.padding, self.dilation, self.ceil_mode,
550550
self.return_indices)
551551

552+
def __repr__(self):
553+
return self.__class__.__name__ + ' (' \
554+
+ 'size=' + str(self.kernel_size) \
555+
+ ', stride=' + str(self.stride) \
556+
+ ', padding=' + str(self.padding) \
557+
+ ', dilation=' + str(self.dilation) \
558+
+ ', ceil_mode=' + str(self.ceil_mode) + ')'
559+
552560

553561
class AvgPool3d(Module):
554562
r"""Applies a 3D average pooling over an input signal composed of several input

0 commit comments

Comments
 (0)