Skip to content

Commit ac5dc51

Browse files
authored
Adding _log_api_usage_once to Swin's reusable components. (#6174)
1 parent d1b2f4a commit ac5dc51

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)