Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchvision/models/swin_transformer.py
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