code: def _stdtrit_partials(df, p, return_value=False):
      """Return the partial derivatives of `stdtrit(df, p)`."""
      dtype = dtype_util.common_dtype([df, p], tf.float32)
      numpy_dtype = dtype_util.as_numpy_dtype(dtype)
  
      df, p = [
          tf.convert_to_tensor(param, dtype=dtype) for param in (df, p)
      ]
      broadcast_shape = functools.reduce(
          ps.broadcast_shape, [ps.shape(df), ps.shape(p)]
      )
      df, p = [
          tf.broadcast_to(param, broadcast_shape) for param in (df, p)
      ]
  
      # We use the fact that stdtr and stdtrit are inverses of each other to
      # compute the gradients.
      t = _stdtrit_custom_gradient(df, p)
      stdtr_partial_df, stdtr_partial_t = _stdtr_partials(df, t)
  
      partial_df = -stdtr_partial_df / stdtr_partial_t
      partial_p = tf.math.reciprocal(stdtr_partial_t)
  
      if return_value:
          results = [partial_df, partial_p, t]
      else:
          results = [partial_df, partial_p]
  
      # Determine if the inputs are out of range (should return NaN output).
      results = [
          tf.where(
              (p <= 0.0) | (p >= 1.0) | (df <= 0.0),
              numpy_dtype(np.nan),
              result,
          )
          for result in results
      ]
  
      return results
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.internal import assert_util
  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 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 special_math
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import generic
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math import numeric
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 16 for calling a global function with example usage: _stdtrit_partials(df, p, return_value) and returns: results