Skip to content

Commit 6a36621

Browse files
committed
mypy compliance
1 parent 9635a07 commit 6a36621

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

axelrod/strategies/attention.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def __init__(
352352
self,
353353
) -> None:
354354
super().__init__()
355-
self.model = None
355+
self.model: Optional[PlayerModel] = None
356356

357357
def load_model(self) -> None:
358358
"""Load the model weights."""
@@ -366,6 +366,8 @@ def strategy(self, opponent: Player) -> Action:
366366
"""Actual strategy definition that determines player's action."""
367367
# Load the model if not already loaded
368368
self.load_model()
369+
assert self.model is not None, "Model must be loaded before playing."
370+
369371
# Compute features
370372
features = compute_features(self, opponent).unsqueeze(0).to(DEVICES)
371373

0 commit comments

Comments
 (0)