(ls_module: LayerScale)
| 55 | |
| 56 | |
| 57 | def ls_apply_patch(ls_module: LayerScale): |
| 58 | ls_module.scale_factor = nn.Parameter(ls_module.gamma.clone()) |
| 59 | ls_module.forward = _ls_new_forward.__get__(ls_module, LayerScale) |
| 60 | del ls_module.gamma |
| 61 | |
| 62 | |
| 63 | # === Prismatic Vision Backbone (nn.Module) Definitions (w/ Fused Backbone Support) === |