code: def _choose_gradient_estimator(
      use_reparameterization, reparameterization_types
  ):
      """Infers a default gradient estimator from args to a variational loss."""
      if use_reparameterization is None:
          use_reparameterization = all(
              reparameterization_type == FULLY_REPARAMETERIZED
              for reparameterization_type in reparameterization_types
          )
      if use_reparameterization:
          return GradientEstimators.REPARAMETERIZATION
      else:
          warnings.warn(
              "Using score-function gradient estimate, which may have high "
              "variance. To disable this warning, explicitly pass "
              "`gradient_estimator=tfp.vi.GradientEstimators.SCORE_FUNCTION`."
          )
          return GradientEstimators.SCORE_FUNCTION
  
imports: import enum
  import functools
  import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python import monte_carlo
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal.reparameterization import FULLY_REPARAMETERIZED
  from tensorflow_probability.python.stats.leave_one_out import log_soomean_exp
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 18 for calling a global function with example usage: _choose_gradient_estimator(use_reparameterization, reparameterization_types) and returns: GradientEstimators, GradientEstimators