class_docstr: Drop paths (Stochastic Depth) per sample  (when applied in main path of
  residual blocks).
  
  Args:
      drop_prob (float): Drop rate for paths of model. Dropout rate has
          to be between 0 and 1. Default: 0.
class_docstr_tok: ["Drop","paths","(","Stochastic","Depth",")","per","sample","(","when","applied","in","main","path","of","residual","blocks",")",".","Args",":","drop_prob","(","float",")",":","Drop","rate","for","paths","of","model",".","Dropout","rate","has","to","be","between","0","and","1",".","Default",":","0","."]
code: def forward(self, x):
      if self.drop_prob == 0.0 or not self.training:
          return x
      shape = (x.shape[0],) + (1,) * (
          x.ndim - 1
      )  # work with diff dim tensors, not just 2D ConvNets
      random_tensor = self.keep_prob + torch.rand(
          shape, dtype=x.dtype, device=x.device
      )
      random_tensor.floor_()  # binarize
      output = x.div(self.keep_prob) * random_tensor
      return output
  
imports: import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the DropPath obj's underlying member method code with example usage: obj.forward(x) and returns: output, x