Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
53194991
Unverified
Commit
53194991
authored
Jun 27, 2023
by
NielsRogge
Committed by
GitHub
Jun 27, 2023
Browse files
[Mask2Former] Remove SwinConfig (#24259)
Remove SwinConfig
parent
fb6a6276
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
src/transformers/models/mask2former/modeling_mask2former.py
src/transformers/models/mask2former/modeling_mask2former.py
+2
-5
No files found.
src/transformers/models/mask2former/modeling_mask2former.py
View file @
53194991
...
@@ -23,7 +23,7 @@ import numpy as np
...
@@ -23,7 +23,7 @@ import numpy as np
import
torch
import
torch
from
torch
import
Tensor
,
nn
from
torch
import
Tensor
,
nn
from
...
import
AutoBackbone
,
SwinConfig
from
...
import
AutoBackbone
from
...activations
import
ACT2FN
from
...activations
import
ACT2FN
from
...file_utils
import
(
from
...file_utils
import
(
ModelOutput
,
ModelOutput
,
...
@@ -1388,10 +1388,7 @@ class Mask2FormerPixelLevelModule(nn.Module):
...
@@ -1388,10 +1388,7 @@ class Mask2FormerPixelLevelModule(nn.Module):
"""
"""
super
().
__init__
()
super
().
__init__
()
backbone_config_dict
=
config
.
backbone_config
.
to_dict
()
self
.
encoder
=
AutoBackbone
.
from_config
(
config
.
backbone_config
)
backbone_config
=
SwinConfig
.
from_dict
(
backbone_config_dict
)
self
.
encoder
=
AutoBackbone
.
from_config
(
backbone_config
)
self
.
decoder
=
Mask2FormerPixelDecoder
(
config
,
feature_channels
=
self
.
encoder
.
channels
)
self
.
decoder
=
Mask2FormerPixelDecoder
(
config
,
feature_channels
=
self
.
encoder
.
channels
)
def
forward
(
self
,
pixel_values
:
Tensor
,
output_hidden_states
:
bool
=
False
)
->
Mask2FormerPixelLevelModuleOutput
:
def
forward
(
self
,
pixel_values
:
Tensor
,
output_hidden_states
:
bool
=
False
)
->
Mask2FormerPixelLevelModuleOutput
:
...
...
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