code: def sigmoid(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      complex_mode: Literal["split", "magnitude", "jax"] = "jax",
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Apply the sigmoid function element-wise.
  
      Parameters
      ----------
      x
          input array.
      complex_mode
          optional specifier for how to handle complex data types. See
          ``ivy.func_wrapper.handle_complex_input`` for more detail.
      out
          optional output array, for writing the result to. It must have a shape that the
          input broadcast to.
          default: None
  
      Returns
      -------
      ret
          an array containing the sigmoid activation of each element in ``x``.
          sigmoid activation of x is defined as 1/(1+exp(-x)).
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([-1.0, 1.0, 2.0])
      >>> y = ivy.sigmoid(x)
      >>> print(y)
      ivy.array([0.2689414 , 0.7310586 , 0.88079703])
  
      >>> x = ivy.array([-1.0, 1.0, 2.0])
      >>> y = ivy.zeros(3)
      >>> ivy.sigmoid(x, out=y)
      >>> print(y)
      ivy.array([0.2689414 , 0.7310586 , 0.88079703])
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([0.]),
      ...                   b=ivy.Container(c=ivy.array([1.]),
      ...                                   d=ivy.array([2.])))
      >>> y = ivy.sigmoid(x)
      >>> print(y)
      {
          a: ivy.array([0.5]),
          b: {
              c: ivy.array([0.7310586]),
              d: ivy.array([0.88079703])
          }
      }
  
      >>> x = ivy.Container(a=ivy.array([0.]),
      ...                   b=ivy.Container(c=ivy.array([1.]),
      ...                                   d=ivy.array([2.])))
      >>> y = ivy.Container(a=ivy.array([0.]),
      ...                   b=ivy.Container(c=ivy.array([0.]),
      ...                                   d=ivy.array([0.])))
      >>> ivy.sigmoid(x, out=y)
      >>> print(y)
      {
          a: ivy.array([0.5]),
          b: {
              c: ivy.array([0.7310586]),
              d: ivy.array([0.88079703])
          }
      }
      """
      return current_backend(x).sigmoid(x, out=out)
  
imports: from typing import Union, Optional, Callable, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_complex_input, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 8 for calling a global function with example usage: sigmoid() and returns: current_backend