Skip to content

Commit

Permalink
Block.drop_path() was deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
AyaanShah2204 committed Aug 10, 2023
1 parent fff2ae6 commit d91090e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions midas/backbones/beit.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ def block_forward(self, x, resolution, shared_rel_pos_bias: Optional[torch.Tenso
Modification of timm.models.beit.py: Block.forward to support arbitrary window sizes.
"""
if self.gamma_1 is None:
x = x + self.drop_path(self.attn(self.norm1(x), resolution, shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path(self.mlp(self.norm2(x)))
x = x + self.drop_path1(self.attn(self.norm1(x), resolution, shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path2(self.mlp(self.norm2(x)))
else:
x = x + self.drop_path(self.gamma_1 * self.attn(self.norm1(x), resolution,
x = x + self.drop_path1(self.gamma_1 * self.attn(self.norm1(x), resolution,
shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path(self.gamma_2 * self.mlp(self.norm2(x)))
x = x + self.drop_path2(self.gamma_2 * self.mlp(self.norm2(x)))
return x


Expand Down

0 comments on commit d91090e

Please sign in to comment.