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:**
  
  - `p`: The fraction of entries to set to zero. (On average.)
  - `inference`: Whether to actually apply dropout at all. If `True` then dropout
      is *not* applied. If `False` then dropout is applied. This may be toggled
      with [`equinox.nn.inference_mode`][] or overridden during
      [`equinox.nn.Dropout.__call__`][].
  - `deterministic`: Deprecated alternative to `inference`.
docstr_tok: ["*","*","Arguments",":","*","*","-","`","p","`",":","The","fraction","of","entries","to","set","to","zero",".","(","On","average",".",")","-","`","inference","`",":","Whether","to","actually","apply","dropout","at","all",".","If","`","True","`","then","dropout","is","*","not","*","applied",".","If","`","False","`","then","dropout","is","applied",".","This","may","be","toggled","with","[","`","equinox.nn.inference_mode","`","]","[","]","or","overridden","during","[","`","equinox.nn.Dropout.__call__","`","]","[","]",".","-","`","deterministic","`",":","Deprecated","alternative","to","`","inference","`","."]
code: def __init__(
      self,
      p: float = 0.5,
      inference: bool = False,
      *,
      deterministic: Optional[bool] = None,
  ):
      """**Arguments:**
  
      - `p`: The fraction of entries to set to zero. (On average.)
      - `inference`: Whether to actually apply dropout at all. If `True` then dropout
          is *not* applied. If `False` then dropout is applied. This may be toggled
          with [`equinox.nn.inference_mode`][] or overridden during
          [`equinox.nn.Dropout.__call__`][].
      - `deterministic`: Deprecated alternative to `inference`.
      """
  
      if deterministic is not None:
          inference = deterministic
          warnings.warn(
              "Dropout(deterministic=...) is deprecated "
              "in favour of Dropout(inference=...)"
          )
      self.p = p
      self.inference = inference
  
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 1 to create a new Dropout object from inherited base classes: Module with example: obj = Dropout(p, inference)