Skip to content

Drop path

DropPath

Bases: Module

Drop paths (Stochastic Depth) per sample.

Source code in inference/models/depth_anything_v3/architecture/layers/drop_path.py
27
28
29
30
31
32
33
34
35
class DropPath(nn.Module):
    """Drop paths (Stochastic Depth) per sample."""

    def __init__(self, drop_prob=None):
        super().__init__()
        self.drop_prob = drop_prob

    def forward(self, x):
        return drop_path(x, self.drop_prob, self.training)