class_docstr: Common tests for single-part and multi-part bijectors.
code: def testInputsAreCached(self, steps=4):
      struct = self.test_arg()
      weak_start = cache_util.WeakStructRef(struct)
  
      # Call forward a few times.
      for _ in range(steps):
          struct = self.forward(struct)
  
      print(type(struct), struct)
      self.assertLen(self.forward_keys, steps)
      self.assertEqual(self.bijector.forward_call_count, steps)
      self.assertLen(self.cache.items(direction="forward"), steps)
      self.assertLen(self.inverse_keys, steps)
      self.assertEqual(self.bijector.inverse_call_count, 0)
      self.assertLen(self.cache.items(direction="inverse"), steps)
  
      # Now invert our calls
      for _ in range(steps):
          struct = self.inverse(struct)
  
      self.assertLen(self.forward_keys, 1)  # Has cached attrs.
      self.assertEqual(
          self.bijector.forward_call_count, steps
      )  # No new calls.
      self.assertLen(self.inverse_keys, 0)  # Refs are all gone.
      self.assertEqual(
          self.bijector.inverse_call_count, 0
      )  # All cache hits.
  
      # Original is recoverable. Contents are referentially equal.
      self.assertTrue(weak_start.alive)
      tf.nest.map_structure(self.assertIs, struct, weak_start())
  
      struct = None
      self.assertFalse(weak_start.alive)
      self.assertLen(self.forward_keys, 0)
      self.assertLen(self.inverse_keys, 0)
  
imports: from absl.testing import parameterized
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import cache_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling the CacheTestCommon obj's underlying member method code with example usage: obj.testInputsAreCached(steps) without return types