Skip to content

Commit

Permalink
Update hieradet.py
Browse files Browse the repository at this point in the history
Not used  
head_dim = dim_out // num_heads
self.scale = head_dim**-0.5

F.scaled_dot_product_attention takes care of this automatically.
  • Loading branch information
arun477 authored Aug 7, 2024
1 parent 511199d commit 6ec8560
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions sam2/modeling/backbones/hieradet.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ def __init__(

self.dim = dim
self.dim_out = dim_out

self.num_heads = num_heads
head_dim = dim_out // num_heads
self.scale = head_dim**-0.5


self.q_pool = q_pool
self.qkv = nn.Linear(dim, dim_out * 3)
self.proj = nn.Linear(dim_out, dim_out)
Expand Down

0 comments on commit 6ec8560

Please sign in to comment.