Skip to content

Commit 4f87191

Browse files
committed
Address review comments.
1 parent a96c54c commit 4f87191

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ignite/engine/events.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ def __call__(
9191
raise ValueError("Argument every should be integer and greater than zero")
9292

9393
if once is not None:
94-
# pyrefly: ignore [unsupported-operation]
95-
c1 = isinstance(once, numbers.Integral) and once > 0
94+
c1 = isinstance(once, int) and once > 0
9695
c2 = isinstance(once, Sequence) and len(once) > 0 and all(isinstance(e, int) and e > 0 for e in once)
9796
if not (c1 or c2):
9897
raise ValueError(

ignite/metrics/ssim.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,19 @@ def _gaussian_or_uniform_kernel(
161161
kernel_y = self._gaussian(kernel_size[1], sigma[1])
162162
if ndims == 3:
163163
kernel_z = self._gaussian(kernel_size[2], sigma[2])
164+
else:
165+
kernel_z = None
164166
else:
165167
kernel_x = self._uniform(kernel_size[0])
166168
kernel_y = self._uniform(kernel_size[1])
167169
if ndims == 3:
168170
kernel_z = self._uniform(kernel_size[2])
171+
else:
172+
kernel_z = None
169173

170174
result = (
171175
torch.einsum("i,j->ij", kernel_x, kernel_y)
172176
if ndims == 2
173-
# pyrefly: ignore [unbound-name]
174177
else torch.einsum("i,j,k->ijk", kernel_x, kernel_y, kernel_z)
175178
)
176179
return result

ignite/metrics/vision/object_detection_average_precision_recall.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ def _match_area_range(self, bboxes: torch.Tensor) -> torch.Tensor:
160160
elif self._area_range == "large":
161161
min_area = 9216
162162
max_area = 1e10
163-
# pyrefly: ignore [unbound-name]
163+
else:
164+
min_area = 0
165+
max_area = 1e10
164166
return torch.logical_and(areas >= min_area, areas <= max_area)
165167

166168
def _check_matching_input(

0 commit comments

Comments
 (0)