Skip to content

Commit

Permalink
[fbsync] Adding _log_api_usage_once to Swin's reusable components. (#…
Browse files Browse the repository at this point in the history
…6174)

Reviewed By: datumbox

Differential Revision: D37212662

fbshipit-source-id: 051c69540c15723d3ce0780b8fcba5693cc9114a
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Jun 17, 2022
1 parent b5c5fbb commit 4547984
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchvision/models/swin_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PatchMerging(nn.Module):

def __init__(self, dim: int, norm_layer: Callable[..., nn.Module] = nn.LayerNorm):
super().__init__()
_log_api_usage_once(self)
self.dim = dim
self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False)
self.norm = norm_layer(4 * dim)
Expand Down Expand Up @@ -268,6 +269,7 @@ def __init__(
attn_layer: Callable[..., nn.Module] = ShiftedWindowAttention,
):
super().__init__()
_log_api_usage_once(self)

self.norm1 = norm_layer(dim)
self.attn = attn_layer(
Expand Down

0 comments on commit 4547984

Please sign in to comment.