code: def _random_gamma_jvp(shape, log_space, primals, tangents):
      """Computes JVP for gamma sample (supports JAX custom derivative)."""
      concentration, rate, log_rate, seed = primals
      dconcentration, drate, dlog_rate, dseed = tangents
      del dseed
      # TODO(https://github.com/google/jax/issues/3768): eliminate broadcast_to?
      dconcentration = tf.broadcast_to(dconcentration, shape)
      drate = 0 if drate is None else tf.broadcast_to(drate, shape)
      dlog_rate = (
          0 if dlog_rate is None else tf.broadcast_to(dlog_rate, shape)
      )
  
      samples, impl = _random_gamma_no_gradient(
          shape, concentration, rate, log_rate, seed, log_space
      )
  
      (
          partial_concentration,
          partial_rate,
          partial_log_rate,
      ) = _compute_partials(
          samples, concentration, rate, log_rate, log_space
      )
  
      dsamples = (
          partial_concentration * dconcentration
          + partial_rate * drate
          + partial_log_rate * dlog_rate
      )
      return ((samples, impl), (dsamples, tf.zeros_like(impl)))
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import batched_rejection_sampler
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import implementation_selection
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  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.math import generic
  from tensorflow_probability.python.math import special
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 10 for calling a global function with example usage: _random_gamma_jvp(shape, log_space, primals, tangents) and returns: samples,  impl,  dsamples,  tf