code: def _validate_bijector_fn(bijector_fn):
      """Validates the output of `bijector_fn`."""
  
      def _wrapper(x, **condition_kwargs):
          """A wrapper that validates `bijector_fn`."""
          bijector = bijector_fn(x, **condition_kwargs)
          if (
              bijector.forward_min_event_ndims
              != bijector.inverse_min_event_ndims
          ):
              # Current code won't really work with this, but in principle we could
              # implement this.
              raise ValueError(
                  "Bijectors which alter `event_ndims` are not supported."
              )
          if bijector.forward_min_event_ndims > 0:
              # Mustn't break auto-regressivity,
              raise ValueError(
                  "Bijectors with `forward_min_event_ndims` > 0 are not supported."
              )
          return bijector
  
      return _wrapper
  
imports: import numpy
  import six
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.numeric import clip_by_value_preserve_gradient
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 12 for calling a global function with example usage: _validate_bijector_fn(bijector_fn) and returns: _wrapper, bijector