code: def huber_loss(
      input: JaxArray,
      target: JaxArray,
      /,
      *,
      delta: float = 1.0,
      reduction: str = "mean",
  ) -> JaxArray:
      residual = jnp.abs(input - target)
      quadratic_loss = 0.5 * (residual**2)
      linear_loss = delta * residual - 0.5 * (delta**2)
      loss = jnp.where(residual < delta, quadratic_loss, linear_loss)
  
      if reduction == "mean":
          loss = jnp.mean(loss)
      elif reduction == "sum":
          loss = jnp.sum(loss)
  
      return loss
  
file_path: ivy/ivy/functional/backends/jax/experimental/losses.py
imports: import jax.numpy
  from typing import Optional
  from ivy.functional.backends.jax import JaxArray
  from ivy.func_wrapper import with_supported_device_and_dtypes
  from .None import backend_version
label_desc: Use image node_id 1 for calling a global function with example usage: huber_loss() and returns: loss