Update modeling_intern_vit.py
Browse files- modeling_intern_vit.py +5 -2
modeling_intern_vit.py
CHANGED
|
@@ -309,9 +309,12 @@ class InternVisionEncoder(nn.Module):
|
|
| 309 |
super().__init__()
|
| 310 |
self.config = config
|
| 311 |
# stochastic depth decay rule
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
| 313 |
self.layers = nn.ModuleList([
|
| 314 |
-
InternVisionEncoderLayer(config,
|
| 315 |
self.gradient_checkpointing = True
|
| 316 |
|
| 317 |
def forward(
|
|
|
|
| 309 |
super().__init__()
|
| 310 |
self.config = config
|
| 311 |
# stochastic depth decay rule
|
| 312 |
+
# [Modified]
|
| 313 |
+
# dpr = [x.item() for x in torch.linspace(0, config.drop_path_rate, config.num_hidden_layers)]
|
| 314 |
+
# self.layers = nn.ModuleList([
|
| 315 |
+
# InternVisionEncoderLayer(config, dpr[idx]) for idx in range(config.num_hidden_layers)])
|
| 316 |
self.layers = nn.ModuleList([
|
| 317 |
+
InternVisionEncoderLayer(config, 0.0) for idx in range(config.num_hidden_layers)])
|
| 318 |
self.gradient_checkpointing = True
|
| 319 |
|
| 320 |
def forward(
|