"vscode:/vscode.git/clone" did not exist on "a46a323ea24bec9aa2806ecf597059318840f360"
Unverified Commit ac5dc51a authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Adding `_log_api_usage_once` to Swin's reusable components. (#6174)

parent d1b2f4a1
...@@ -34,6 +34,7 @@ class PatchMerging(nn.Module): ...@@ -34,6 +34,7 @@ class PatchMerging(nn.Module):
def __init__(self, dim: int, norm_layer: Callable[..., nn.Module] = nn.LayerNorm): def __init__(self, dim: int, norm_layer: Callable[..., nn.Module] = nn.LayerNorm):
super().__init__() super().__init__()
_log_api_usage_once(self)
self.dim = dim self.dim = dim
self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False) self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False)
self.norm = norm_layer(4 * dim) self.norm = norm_layer(4 * dim)
...@@ -268,6 +269,7 @@ class SwinTransformerBlock(nn.Module): ...@@ -268,6 +269,7 @@ class SwinTransformerBlock(nn.Module):
attn_layer: Callable[..., nn.Module] = ShiftedWindowAttention, attn_layer: Callable[..., nn.Module] = ShiftedWindowAttention,
): ):
super().__init__() super().__init__()
_log_api_usage_once(self)
self.norm1 = norm_layer(dim) self.norm1 = norm_layer(dim)
self.attn = attn_layer( self.attn = attn_layer(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment