class_docstr: DropPath class
class_docstr_tok: ["DropPath","class"]
docstr: drop path op
  Args:
      input: tensor with arbitrary shape
      drop_prob: float number of drop path probability, default: 0.0
      training: bool, if current mode is training, default: False
  Returns:
      output: output tensor after drop path
docstr_tok: ["drop","path","op","Args",":","input",":","tensor","with","arbitrary","shape","drop_prob",":","float","number","of","drop","path","probability",",","default",":","0.0","training",":","bool",",","if","current","mode","is","training",",","default",":","False","Returns",":","output",":","output","tensor","after","drop","path"]
code: def drop_path(self, inputs):
      """drop path op
      Args:
          input: tensor with arbitrary shape
          drop_prob: float number of drop path probability, default: 0.0
          training: bool, if current mode is training, default: False
      Returns:
          output: output tensor after drop path
      """
      # if prob is 0 or eval mode, return original input
      if self.drop_prob == 0.0 or not self.training:
          return inputs
      keep_prob = 1 - self.drop_prob
      keep_prob = paddle.to_tensor(keep_prob, dtype="float32")
      shape = (inputs.shape[0],) + (1,) * (
          inputs.ndim - 1
      )  # shape=(N, 1, 1, 1)
      random_tensor = keep_prob + paddle.rand(shape, dtype=inputs.dtype)
      random_tensor = random_tensor.floor()  # mask
      output = (
          inputs.divide(keep_prob) * random_tensor
      )  # divide is to keep same output expectation
      return output
  
imports: import paddle
  import paddle.nn
label_desc: Use image node_id 2 for calling the DropPath obj's underlying member method code with example usage: obj.drop_path(inputs) and returns: output, inputs