Skip to content

Commit a60977e

Browse files
author
Kai
committed
__repr__ for transforms.RandomErasing
1 parent 8a82017 commit a60977e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

torchvision/transforms/transforms.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,13 @@ def forward(self, img):
16301630
return F.erase(img, x, y, h, w, v, self.inplace)
16311631
return img
16321632

1633+
def __repr__(self):
1634+
s = '(p={}, '.format(self.p)
1635+
s += 'scale={}, '.format(self.scale)
1636+
s += 'ratio={}, '.format(self.ratio)
1637+
s += 'value={}, '.format(self.value)
1638+
s += 'inplace={})'.format(self.inplace)
1639+
return self.__class__.__name__ + s
16331640

16341641
class GaussianBlur(torch.nn.Module):
16351642
"""Blurs image with randomly chosen Gaussian blur.

0 commit comments

Comments
 (0)