Skip to content

Commit 4547984

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Adding _log_api_usage_once to Swin's reusable components. (#6174)
Reviewed By: datumbox Differential Revision: D37212662 fbshipit-source-id: 051c69540c15723d3ce0780b8fcba5693cc9114a
1 parent b5c5fbb commit 4547984

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torchvision/models/swin_transformer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class PatchMerging(nn.Module):
3434

3535
def __init__(self, dim: int, norm_layer: Callable[..., nn.Module] = nn.LayerNorm):
3636
super().__init__()
37+
_log_api_usage_once(self)
3738
self.dim = dim
3839
self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False)
3940
self.norm = norm_layer(4 * dim)
@@ -268,6 +269,7 @@ def __init__(
268269
attn_layer: Callable[..., nn.Module] = ShiftedWindowAttention,
269270
):
270271
super().__init__()
272+
_log_api_usage_once(self)
271273

272274
self.norm1 = norm_layer(dim)
273275
self.attn = attn_layer(

0 commit comments

Comments
 (0)