class_docstr: Test cases for keras model fitting.
class_docstr_tok: ["Test","cases","for","keras","model","fitting","."]
docstr: Tests the fit_generator method of BoltOnModel.
  
  Args:
    generator: True to test with a generator dataset
code: def test_fit_gen(self, generator):
      """Tests the fit_generator method of BoltOnModel.
  
      Args:
        generator: True to test with a generator dataset
      """
      loss = TestLoss(1, 1, 1)
      optimizer = TestOptimizer()
      n_classes = 2
      input_dim = 5
      batch_size = 1
      n_samples = 10
      clf = models.BoltOnModel(n_classes)
      clf.compile(optimizer, loss)
      x = _cat_dataset(
          n_samples,
          input_dim,
          n_classes,
          batch_size,
          generator=generator,
      )
      x = x.batch(batch_size)
      x = x.shuffle(n_samples // 2)
      clf.fit_generator(x, n_samples=n_samples)
      self.assertEqual(hasattr(clf, "layers"), True)
  
imports: from absl.testing import parameterized
  import tensorflow.compat.v1
  from tensorflow.compat.v1.python.framework import ops
  from tensorflow.compat.v1.python.keras import keras_parameterized
  from tensorflow.compat.v1.python.keras import losses
  from tensorflow.compat.v1.python.keras.optimizer_v2.optimizer_v2 import OptimizerV2
  from tensorflow.compat.v1.python.keras.regularizers import L1L2
  from tensorflow_privacy.privacy.bolt_on import models
  from tensorflow_privacy.privacy.bolt_on.losses import StrongConvexMixin
  from tensorflow_privacy.privacy.bolt_on.optimizers import BoltOn
label_desc: Use image node_id 2 for calling the FitTests obj's underlying member method code with example usage: obj.test_fit_gen(generator) without return types