File size: 435 Bytes
58d7142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Patch DropPath for compatibility
"""
try:
    from timm.layers import DropPath
    
    # Patch existing instances to add scale_by_keep
    def patched_droppath_getattr(self, name):
        if name == 'scale_by_keep':
            return True
        return object.__getattribute__(self, name)
    
    DropPath.__getattr__ = patched_droppath_getattr
    
    print("DropPath patched for compatibility")
except ImportError:
    pass