class_docstr: Applies dropout.
  
  Note that this layer behaves differently during training and inference. During
  training then dropout is randomly applied; during inference this layer does nothing.
  Whether the model is in training or inference mode should be toggled using
  [`equinox.nn.inference_mode`][].
class_docstr_tok: ["Applies","dropout",".","Note","that","this","layer","behaves","differently","during","training","and","inference",".","During","training","then","dropout","is","randomly","applied",";","during","inference","this","layer","does","nothing",".","Whether","the","model","is","in","training","or","inference","mode","should","be","toggled","using","[","`","equinox.nn.inference_mode","`","]","[","]","."]
docstr: **Arguments:**
  
  - `x`: An any-dimensional JAX array to dropout.
  - `key`: A `jax.random.PRNGKey` used to provide randomness for calculating
      which elements to dropout. (Keyword only argument.)
  - `inference`: As per [`equinox.nn.Dropout.__init__`][]. If `True` or
      `False` then it will take priority over `self.inference`. If `None`
      then the value from `self.inference` will be used.
  - `deterministic`: Deprecated alternative to `inference`.
docstr_tok: ["*","*","Arguments",":","*","*","-","`","x","`",":","An","any-dimensional","JAX","array","to","dropout",".","-","`","key","`",":","A","`","jax.random.PRNGKey","`","used","to","provide","randomness","for","calculating","which","elements","to","dropout",".","(","Keyword","only","argument",".",")","-","`","inference","`",":","As","per","[","`","equinox.nn.Dropout.__init__","`","]","[","]",".","If","`","True","`","or","`","False","`","then","it","will","take","priority","over","`","self.inference","`",".","If","`","None","`","then","the","value","from","`","self.inference","`","will","be","used",".","-","`","deterministic","`",":","Deprecated","alternative","to","`","inference","`","."]
code: def __call__(
      self,
      x: Array,
      *,
      key: Optional[PRNGKeyArray] = None,
      inference: Optional[bool] = None,
      deterministic: Optional[bool] = None,
  ) -> Array:
      """**Arguments:**
  
      - `x`: An any-dimensional JAX array to dropout.
      - `key`: A `jax.random.PRNGKey` used to provide randomness for calculating
          which elements to dropout. (Keyword only argument.)
      - `inference`: As per [`equinox.nn.Dropout.__init__`][]. If `True` or
          `False` then it will take priority over `self.inference`. If `None`
          then the value from `self.inference` will be used.
      - `deterministic`: Deprecated alternative to `inference`.
      """
  
      if deterministic is not None:
          inference = deterministic
          warnings.warn(
              "Dropout()(deterministic=...) is deprecated "
              "in favour of Dropout()(inference=...)"
          )
  
      if inference is None:
          inference = self.inference
      if isinstance(self.p, (int, float)) and self.p == 0:
          inference = True
      if inference:
          return x
      elif key is None:
          raise RuntimeError(
              "Dropout requires a key when running in non-deterministic mode."
          )
      else:
          q = 1 - lax.stop_gradient(self.p)
          mask = jrandom.bernoulli(key, q, x.shape)
          return jnp.where(mask, x / q, 0)
  
file_path: equinox/equinox/nn/_dropout.py
imports: import warnings
  from typing import Optional
  import jax
  import jax.lax
  import jax.numpy
  import jax.random
  from jaxtyping import Array, PRNGKeyArray
  from .._module import Module
label_desc: Use image node_id 3 for calling the Dropout obj's underlying member method code with example usage: obj.__call__(x) and returns: x, jnp