Skip to content

Commit 8053894

Browse files
committed
suppress possibly-missing-attribute warnings
1 parent 463e027 commit 8053894

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fsrs/scheduler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,9 @@ def _next_interval(self, *, stability: float) -> int:
658658
)
659659

660660
if not isinstance(next_interval, Real): # type(next_interval) is torch.Tensor
661-
next_interval = next_interval.detach().item()
661+
next_interval = (
662+
next_interval.detach().item() # ty: ignore[possibly-missing-attribute]
663+
)
662664

663665
next_interval = round(next_interval) # intervals are full days
664666

@@ -679,7 +681,7 @@ def _short_term_stability(self, *, stability: float, rating: Rating) -> float:
679681
if isinstance(short_term_stability_increase, Real):
680682
short_term_stability_increase = max(short_term_stability_increase, 1.0)
681683
else: # type(short_term_stability_increase) is torch.Tensor
682-
short_term_stability_increase = short_term_stability_increase.clamp(
684+
short_term_stability_increase = short_term_stability_increase.clamp( # ty: ignore[possibly-missing-attribute]
683685
min=1.0
684686
)
685687

0 commit comments

Comments
 (0)