class_docstr: Test models are set in the right mode at the right time.
class_docstr_tok: ["Test","models","are","set","in","the","right","mode","at","the","right","time","."]
docstr: Test ``BaseModule.predict_scores``.
docstr_tok: ["Test","``","BaseModule.predict_scores","``","."]
code: def test_predict_scores(self) -> None:
      """Test ``BaseModule.predict_scores``."""
      batch = torch.zeros(
          self.batch_size, 3, dtype=torch.long, device=self.model.device
      )
  
      # Set into training mode to check if it is correctly set to evaluation mode.
      self.model.train()
  
      scores = self.model.predict_hrt(batch)
      assert scores.shape == (self.batch_size, 1)
      self._check_scores(scores)
  
      assert not self.model.training
  
imports: import unittest
  from dataclasses import dataclass
  from typing import Callable
  import torch
  from pykeen.datasets import Nations
  from pykeen.models import FixedModel, Model, TransE
  from pykeen.triples import TriplesFactory
  from pykeen.typing import COLUMN_HEAD, COLUMN_RELATION, COLUMN_TAIL, Target
  from pykeen.utils import extend_batch, resolve_device
label_desc: Use image node_id 5 for calling the TestBaseModel obj's underlying member method code with example usage: obj.test_predict_scores() without return types