class_docstr: Test for evaluation callback.
class_docstr_tok: ["Test","for","evaluation","callback","."]
docstr: Test batch size gets updated by automatic memory optimization.
docstr_tok: ["Test","batch","size","gets","updated","by","automatic","memory","optimization","."]
code: def test_batch_size(self):
      """Test batch size gets updated by automatic memory optimization."""
      assert isinstance(self.instance, EvaluationTrainingCallback)
      with mock.patch.object(
          Evaluator,
          "evaluate",
          side_effect=self.instance.evaluator.evaluate,
      ) as mock_evaluate:
          pipeline(
              dataset="nations",
              model="distmult",
              training_kwargs=dict(
                  callbacks=self.instance,
              ),
          )
          assert {
              c.kwargs.get("batch_size", None)
              for c in mock_evaluate.call_args_list
          } != {None}
  
file_path: pykeen/tests/test_training/test_callbacks.py
imports: import unittest
  from typing import Any, MutableMapping
  from unittest import mock
  import torch
  from pykeen.evaluation.evaluator import Evaluator
  from pykeen.pipeline import pipeline
  from pykeen.training.callbacks import EvaluationLossTrainingCallback, EvaluationTrainingCallback
  from ..None import cases
label_desc: Use image node_id 2 for calling the EvaluationTrainingCallbackTestCase obj's underlying member method code with example usage: obj.test_batch_size() without return types