code: def _ldj_tensor_conversions_allowed(bijector, is_forward):
      if is_invert(bijector):
          return _ldj_tensor_conversions_allowed(
              bijector.bijector, not is_forward
          )
      elif is_transform_diagonal(bijector):
          return _ldj_tensor_conversions_allowed(
              bijector.diag_bijector, is_forward
          )
      elif is_generalized_pareto(bijector):
          return max(
              _ldj_tensor_conversions_allowed(
                  bijector._negative_concentration_bijector(),
                  is_forward,
              ),
              _ldj_tensor_conversions_allowed(
                  bijector._non_negative_concentration_bijector,
                  is_forward,
              ),
          )
      elif is_forward:
          return (
              2 if hasattr(bijector, "_forward_log_det_jacobian") else 4
          )
      else:
          return (
              2 if hasattr(bijector, "_inverse_log_det_jacobian") else 4
          )
  
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 10 for calling a global function with example usage: _ldj_tensor_conversions_allowed(bijector, is_forward) and returns: _ldj_tensor_conversions_allowed, _ldj_tensor_conversions_allowed, max, unknown, unknown