code: def test_save_restore_functor(self):
      f = lambda x: x**2
      a = tf.constant([3.0, 2.0])
      ct = ThingWithCallableArg(a, f=f)
  
      with self.assertRaisesRegex(ValueError, "Cannot serialize"):
          tf.__internal__.saved_model.encode_structure(
              ct._type_spec
          )  # pylint: disable=protected-access
  
      @auto_composite_tensor.auto_composite_tensor(
          module_name="my.module"
      )
      class F(auto_composite_tensor.AutoCompositeTensor):
          def __call__(self, *args, **kwargs):
              return f(*args, **kwargs)
  
      ct_functor = ThingWithCallableArg(a, f=F())
      enc = tf.__internal__.saved_model.encode_structure(
          ct_functor._type_spec
      )
      dec = tf.__internal__.saved_model.decode_proto(enc)
      self.assertEqual(dec, ct_functor._type_spec)
  
imports: import functools
  import os
  from absl import flags
  from absl.testing import parameterized
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import reshape
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.bijectors import transform_diagonal
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.experimental.distributions import mvn_precision_factor_linop
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import test_util
  from absl.testing import absltest
label_desc: Use image node_id 18 for calling the AutoCompositeTensorTest obj's underlying member method code with example usage: obj.test_save_restore_functor() and returns: f