Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
ac5dc51a
Unverified
Commit
ac5dc51a
authored
Jun 16, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Jun 16, 2022
Browse files
Adding `_log_api_usage_once` to Swin's reusable components. (#6174)
parent
d1b2f4a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
torchvision/models/swin_transformer.py
torchvision/models/swin_transformer.py
+2
-0
No files found.
torchvision/models/swin_transformer.py
View file @
ac5dc51a
...
...
@@ -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 @@ class SwinTransformerBlock(nn.Module):
attn_layer
:
Callable
[...,
nn
.
Module
]
=
ShiftedWindowAttention
,
):
super
().
__init__
()
_log_api_usage_once
(
self
)
self
.
norm1
=
norm_layer
(
dim
)
self
.
attn
=
attn_layer
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment