class_docstr: Stochastic depth module.
  
  See :func:`stochastic_depth`.
code: def __init__(self, p: float, mode: str) -> None:
      # NOTE: need to upgrade to torchvision==0.11.0 to use StochasticDepth directly
      # from torchvision.ops import StochasticDepth
      super().__init__()
      self.p = p
      self.mode = mode
  
imports: import math
  from functools import partial
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange
  from opt_einsum import contract
label_desc: Use image node_id 1 to create a new StochasticDepth object from inherited base classes: nn with example: obj = StochasticDepth(p, mode)