code: def logpdf(
      x: ArrayLike,
      df: ArrayLike,
      loc: ArrayLike = 0,
      scale: ArrayLike = 1,
  ) -> Array:
      x, df, loc, scale = promote_args_inexact(
          "chi2.logpdf", x, df, loc, scale
      )
      one = _lax_const(x, 1)
      two = _lax_const(x, 2)
      y = lax.div(lax.sub(x, loc), scale)
      df_on_two = lax.div(df, two)
  
      kernel = lax.sub(
          lax.mul(lax.sub(df_on_two, one), lax.log(y)), lax.div(y, two)
      )
  
      nrml_cnst = lax.neg(
          lax.add(
              lax.lgamma(df_on_two),
              lax.div(lax.mul(lax.log(two), df), two),
          )
      )
  
      log_probs = lax.add(lax.sub(nrml_cnst, lax.log(scale)), kernel)
      return jnp.where(lax.lt(x, loc), -jnp.inf, log_probs)
  
file_path: jax/jax/_src/scipy/stats/chi2.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 gammainc, gammaincc
label_desc: Use image node_id 1 for calling a global function with example usage: logpdf(x, df, loc, scale) and returns: jnp