Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,11 @@ def script_func(x_, offset_, weight_, bias_, stride_, pad_, dilation_):
class FrozenBNTester(unittest.TestCase):
def test_frozenbatchnorm2d_repr(self):
num_features = 32
t = ops.misc.FrozenBatchNorm2d(num_features)
eps = 1e-5
t = ops.misc.FrozenBatchNorm2d(num_features, eps=eps)

# Check integrity of object __repr__ attribute
expected_string = f"FrozenBatchNorm2d({num_features})"
expected_string = f"FrozenBatchNorm2d({num_features}, eps={eps})"
self.assertEqual(t.__repr__(), expected_string)

def test_frozenbatchnorm2d_eps(self):
Expand Down
2 changes: 1 addition & 1 deletion torchvision/ops/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ def forward(self, x: Tensor) -> Tensor:
return x * scale + bias

def __repr__(self) -> str:
return f"{self.__class__.__name__}({self.weight.shape[0]})"
return f"{self.__class__.__name__}({self.weight.shape[0]}, eps={self.eps})"