From 7a31b0864f80ce27b07e3584a1c96d1994e4fd49 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Thu, 16 Jun 2022 12:58:32 +0100 Subject: [PATCH] Adding _log_api_usage_once to Swin's reusable components. --- torchvision/models/swin_transformer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torchvision/models/swin_transformer.py b/torchvision/models/swin_transformer.py index c56093ed4bf..2f2cfd44445 100644 --- a/torchvision/models/swin_transformer.py +++ b/torchvision/models/swin_transformer.py @@ -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) @@ -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(