code: def constrain_inverse_shape(bijector, shape):
      """Constrain the shape so it is compatible with bijector.inverse.
  
      Args:
        bijector: A `Bijector`.
        shape: A TensorShape or compatible, giving the desired event shape.
  
      Returns:
        shape: A TensorShape, giving an event shape compatible with
          `bijector.inverse`, loosely inspired by the input `shape`.
      """
      if is_invert(bijector):
          return constrain_forward_shape(bijector.bijector, shape=shape)
      if isinstance(bijector, tfb.Reshape):
          # Note: This relies on the out event shape being fully determined
          shape = tf.get_static_value(bijector._event_shape_out)
      return tf.TensorShape(shape)
  
imports: import collections
  import functools
  from absl.testing import parameterized
  import hypothesis
  from hypothesis import strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python import bijectors
  from tensorflow_probability.python import util
  from tensorflow_probability.python.bijectors import hypothesis_testlib
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 6 for calling a global function with example usage: constrain_inverse_shape(bijector, shape) and returns: tf, constrain_forward_shape