class_docstr: Common tests for single-part and multi-part bijectors.
code: def testAttributesAreLazilyPropagated(self):
      x = self.test_arg()
      attrs = self.cache.forward_attributes(x)
      attrs["foo"] = "bar"
  
      # Attributes only exist in from_x
      self.assertEqual(attrs, {"foo": "bar"})
      self.assertLen(self.forward_keys, 1)
      self.assertLen(self.inverse_keys, 0)
  
      # Once we call from_x, they get shared.
      y = self.forward(x)
      attrs = self.cache.inverse_attributes(y)
      self.assertEqual(attrs, {"foo": "bar"})
      self.assertLen(self.forward_keys, 1)
      self.assertLen(self.inverse_keys, 1)
  
      # Add some attrs to y, and clear the reference.
      y = None
      attrs["xxx"] = "yyy"
      self.assertLen(self.inverse_keys, 0)
      self.assertLen(self.forward_keys, 1)
  
      # Cached attributes still exist for `x`
      self.assertEqual(
          self.cache.forward_attributes(x), {"foo": "bar", "xxx": "yyy"}
      )
  
      # Clear x, and the rest of the attrs are gone.
      x = None
      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 4 for calling the CacheTestCommon obj's underlying member method code with example usage: obj.testAttributesAreLazilyPropagated() without return types