code: def softplus(
      x: JaxArray,
      /,
      *,
      beta: Optional[Union[int, float]] = None,
      threshold: Optional[Union[int, float]] = None,
      complex_mode="jax",
      out: Optional[JaxArray] = None,
  ) -> JaxArray:
      if beta is not None and beta != 1:
          x_beta = x * beta
          res = (
              jnp.add(
                  jnp.log1p(jnp.exp(-jnp.abs(x_beta))),
                  jnp.maximum(x_beta, 0).astype(x.dtype),
              )
          ) / beta
      else:
          x_beta = x
          res = jnp.add(
              jnp.log1p(jnp.exp(-jnp.abs(x_beta))),
              jnp.maximum(x_beta, 0).astype(x.dtype),
          )
      if threshold is not None:
          return jnp.where(x_beta > threshold, x, res).astype(x.dtype)
      return res.astype(x.dtype)
  
file_path: ivy/ivy/functional/backends/jax/activations.py
imports: import jax
  import jax.numpy
  from typing import Optional, Union, Literal
  from ivy.functional.backends.jax import JaxArray
label_desc: Use image node_id 6 for calling a global function with example usage: softplus() and returns: res, jnp