We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9635a07 commit 6a36621Copy full SHA for 6a36621
axelrod/strategies/attention.py
@@ -352,7 +352,7 @@ def __init__(
352
self,
353
) -> None:
354
super().__init__()
355
- self.model = None
+ self.model: Optional[PlayerModel] = None
356
357
def load_model(self) -> None:
358
"""Load the model weights."""
@@ -366,6 +366,8 @@ def strategy(self, opponent: Player) -> Action:
366
"""Actual strategy definition that determines player's action."""
367
# Load the model if not already loaded
368
self.load_model()
369
+ assert self.model is not None, "Model must be loaded before playing."
370
+
371
# Compute features
372
features = compute_features(self, opponent).unsqueeze(0).to(DEVICES)
373
0 commit comments