(self, drop_prob: float = 0.0, scale_by_keep: bool = True)
| 163 | """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).""" |
| 164 | |
| 165 | def __init__(self, drop_prob: float = 0.0, scale_by_keep: bool = True): |
| 166 | super(DropPath, self).__init__() |
| 167 | self.drop_prob = drop_prob |
| 168 | self.scale_by_keep = scale_by_keep |
| 169 | |
| 170 | def forward(self, x): |
| 171 | return drop_path(x, self.drop_prob, self.training, self.scale_by_keep) |