Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

remove unused __repr__ code

edgarriba546f30f7e669
diff --git a/test/test_affine.py b/test/test_affine.py
index 88693534c..b5587d5d6 100644
--- a/test/test_affine.py
+++ b/test/test_affine.py
@@ -10,12 +10,6 @@ from common import device_type
class TestRotate:
- def test_smoke(self):
- angle = 0.0
- angle_t = torch.tensor([angle])
- assert str(tgm.Rotate(angle=angle_t)
- ) == 'Rotate(angle=0.0, center=None)'
-
def test_angle90(self):
# prepare input data
inp = torch.tensor([[
diff --git a/torchgeometry/core/affine.py b/torchgeometry/core/affine.py
index 33da2e4ab..293970532 100644
--- a/torchgeometry/core/affine.py
+++ b/torchgeometry/core/affine.py
@@ -222,11 +222,6 @@ class Rotate(nn.Module):
def forward(self, input: torch.Tensor) -> torch.Tensor: # type: ignore
return rotate(input, self.angle, self.center)
- def __repr__(self):
- return self.__class__.__name__ + '(' \
- 'angle={0}, center={1})' \
- .format(self.angle.item(), self.center)
-
class Translate(nn.Module):
r"""Translate the tensor in pixel units.
@@ -247,10 +242,6 @@ class Translate(nn.Module):
def forward(self, input: torch.Tensor) -> torch.Tensor: # type: ignore
return translate(input, self.translation)
- def __repr__(self):
- return self.__class__.__name__ + '(' \
- 'translation={0})'.format(self.translation)
-
class Scale(nn.Module):
r"""Scale the tensor by a factor.
@@ -275,11 +266,6 @@ class Scale(nn.Module):
def forward(self, input: torch.Tensor) -> torch.Tensor: # type: ignore
return scale(input, self.scale_factor, self.center)
- def __repr__(self):
- return self.__class__.__name__ + '(' \
- 'scale_factor={0}, center={1})' \
- .format(self.scale_factor, self.center)
-
class Shear(nn.Module):
r"""Shear the tensor.
@@ -300,7 +286,3 @@ class Shear(nn.Module):
def forward(self, input: torch.Tensor) -> torch.Tensor: # type: ignore
return shear(input, self.shear)
-
- def __repr__(self):
- return self.__class__.__name__ + '(' \
- 'shear={0})'.format(self.shear)