class_docstr: BoltOn Optimizer tests.
class_docstr_tok: ["BoltOn","Optimizer","tests","."]
docstr: Tests rerouted function.
  
  Tests that a method of the internal optimizer is correctly routed from
  the BoltOn instance to the internal optimizer instance (TestOptimizer,
  here).
  
  Args:
    fn: fn to test
    args: arguments to that fn
docstr_tok: ["Tests","rerouted","function",".","Tests","that","a","method","of","the","internal","optimizer","is","correctly","routed","from","the","BoltOn","instance","to","the","internal","optimizer","instance","(","TestOptimizer",",","here",")",".","Args",":","fn",":","fn","to","test","args",":","arguments","to","that","fn"]
code: def test_rerouted_function(self, fn, args):
      """Tests rerouted function.
  
      Tests that a method of the internal optimizer is correctly routed from
      the BoltOn instance to the internal optimizer instance (TestOptimizer,
      here).
  
      Args:
        fn: fn to test
        args: arguments to that fn
      """
      loss = TestLoss(1, 1, 1)
      optimizer = TestOptimizer()
      bolton = opt.BoltOn(optimizer, loss)
      model = TestModel(3)
      model.compile(optimizer, loss)
      model.layers[0].kernel = model.layers[0].kernel_initializer(
          (model.layer_input_shape[0], model.n_outputs)
      )
      model.layers[0].kernel = model.layers[0].kernel_initializer(
          (model.layer_input_shape[0], model.n_outputs)
      )
      bolton._is_init = True  # pylint: disable=protected-access
      bolton.layers = model.layers
      bolton.epsilon = 2
      bolton.noise_distribution = "laplace"
      bolton.n_outputs = 1
      bolton.n_samples = 1
      self.assertEqual(
          getattr(bolton, fn, lambda: "fn not found")(*args), "test"
      )
  
imports: import unittest
  from absl.testing import parameterized
  import tensorflow.compat.v1
  from tensorflow.compat.v1.python import ops
  from tensorflow.compat.v1.python.framework import test_util
  from tensorflow.compat.v1.python.keras import keras_parameterized
  from tensorflow.compat.v1.python.keras import losses
  from tensorflow.compat.v1.python.keras.initializers import constant
  from tensorflow.compat.v1.python.keras.models import Model
  from tensorflow.compat.v1.python.keras.optimizer_v2.optimizer_v2 import OptimizerV2
  from tensorflow.compat.v1.python.keras.regularizers import L1L2
  from tensorflow.compat.v1.python.platform import test
  from tensorflow_privacy.privacy.bolt_on import optimizers
  from tensorflow_privacy.privacy.bolt_on.losses import StrongConvexMixin
label_desc: Use image node_id 6 for calling the BoltonOptimizerTest obj's underlying member method code with example usage: obj.test_rerouted_function(fn, args) without return types