class_docstr: Tests correctness of the Y = g(X) = X transformation.
code: def testMemoryLeak(self):
      if not tf.executing_eagerly():
          return
      # Verifies the fix for a memory leak caused by the mapped value being
      # strongly ref'ed, and the weak key being the same as the value, `x is y`.
      bijector = identity.Identity()
      x = tf.constant(123)
      y = bijector.forward(x)
      self.assertIs(y, x)
      del x
      y = weakref.ref(y)
      # We now expect the reference to be gone.
      self.assertIsNone(y())
  
file_path: probability/tensorflow_probability/python/bijectors/identity_test.py
imports: import weakref
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 3 for calling the IdentityTest obj's underlying member method code with example usage: obj.testMemoryLeak() without return types