class_docstr: Performs layer-dropout (also known as stochastic depth).
  
  Described in
  Huang & Sun et al, "Deep Networks with Stochastic Depth", 2016
  https://arxiv.org/abs/1603.09382
  
  Attributes:
    rate: the layer dropout probability (_not_ the keep rate!).
    deterministic: If false (e.g. in training) the inputs are scaled by `1 / (1
      - rate)` and the layer dropout is applied, whereas if true (e.g. in
      evaluation), no stochastic depth is applied and the inputs are returned as
      is.
class_docstr_tok: ["Performs","layer-dropout","(","also","known","as","stochastic","depth",")",".","Described","in","Huang","&","Sun","et","al",",","``","Deep","Networks","with","Stochastic","Depth","''",",","2016","https",":","\/\/arxiv.org\/abs\/1603.09382","Attributes",":","rate",":","the","layer","dropout","probability","(","_not_","the","keep","rate","!",")",".","deterministic",":","If","false","(","e.g",".","in","training",")","the","inputs","are","scaled","by","`","1","\/","(","1","-","rate",")","`","and","the","layer","dropout","is","applied",",","whereas","if","true","(","e.g",".","in","evaluation",")",",","no","stochastic","depth","is","applied","and","the","inputs","are","returned","as","is","."]
docstr: Applies a stochastic depth mask to the inputs.
  
  Args:
    x: Input tensor.
    deterministic: If false (e.g. in training) the inputs are scaled by `1 /
      (1 - rate)` and the layer dropout is applied, whereas if true (e.g. in
      evaluation), no stochastic depth is applied and the inputs are returned
      as is.
  
  Returns:
    The masked inputs reweighted to preserve mean.
docstr_tok: ["Applies","a","stochastic","depth","mask","to","the","inputs",".","Args",":","x",":","Input","tensor",".","deterministic",":","If","false","(","e.g",".","in","training",")","the","inputs","are","scaled","by","`","1","\/","(","1","-","rate",")","`","and","the","layer","dropout","is","applied",",","whereas","if","true","(","e.g",".","in","evaluation",")",",","no","stochastic","depth","is","applied","and","the","inputs","are","returned","as","is",".","Returns",":","The","masked","inputs","reweighted","to","preserve","mean","."]
code: def __call__(
      self, x: jnp.ndarray, deterministic: Optional[bool] = None
  ) -> jnp.ndarray:
      """Applies a stochastic depth mask to the inputs.
  
      Args:
        x: Input tensor.
        deterministic: If false (e.g. in training) the inputs are scaled by `1 /
          (1 - rate)` and the layer dropout is applied, whereas if true (e.g. in
          evaluation), no stochastic depth is applied and the inputs are returned
          as is.
  
      Returns:
        The masked inputs reweighted to preserve mean.
      """
      broadcast_dims = range(1, x.ndim)
      return nn.Dropout(rate=self.rate, broadcast_dims=broadcast_dims)(
          x, deterministic
      )
  
imports: from typing import Callable, Iterable, Optional, Sequence
  import flax.linen
  import jax
  from jax.nn import initializers
  import jax.numpy
  import numpy
label_desc: Use image node_id 1 for calling the StochasticDepth obj's underlying member method code with example usage: obj.__call__(x, deterministic) and returns: nn