code: def logpdf(
      x: ArrayLike,
      a: ArrayLike,
      loc: ArrayLike = 0,
      scale: ArrayLike = 1,
  ) -> Array:
      x, a, loc, scale = promote_args_inexact(
          "gamma.logpdf", x, a, loc, scale
      )
      one = _lax_const(x, 1)
      y = lax.div(lax.sub(x, loc), scale)
      log_linear_term = lax.sub(xlogy(lax.sub(a, one), y), y)
      shape_terms = lax.add(gammaln(a), lax.log(scale))
      log_probs = lax.sub(log_linear_term, shape_terms)
      return jnp.where(lax.lt(x, loc), -jnp.inf, log_probs)
  
file_path: jax/jax/_src/scipy/stats/gamma.py
imports: import scipy.stats
  from jax import lax
  import jax.numpy
  from jax._src.lax.lax import _const
  from jax._src.numpy.util import _wraps, promote_args_inexact
  from jax._src.typing import Array, ArrayLike
  from jax.scipy.special import gammaln, xlogy, gammainc, gammaincc
label_desc: Use image node_id 1 for calling a global function with example usage: logpdf(x, a, loc, scale) and returns: jnp