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
MMCV
Commits
cb0ee1e3
Unverified
Commit
cb0ee1e3
authored
Apr 17, 2021
by
ZhangShilong
Committed by
GitHub
Apr 17, 2021
Browse files
Remove redundant self.init_cfg (#959)
parent
ae411509
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
3 deletions
+0
-3
mmcv/cnn/bricks/transformer.py
mmcv/cnn/bricks/transformer.py
+0
-3
No files found.
mmcv/cnn/bricks/transformer.py
View file @
cb0ee1e3
...
@@ -61,7 +61,6 @@ class MultiheadAttention(BaseModule):
...
@@ -61,7 +61,6 @@ class MultiheadAttention(BaseModule):
self
.
attn
=
nn
.
MultiheadAttention
(
embed_dims
,
num_heads
,
dropout
,
self
.
attn
=
nn
.
MultiheadAttention
(
embed_dims
,
num_heads
,
dropout
,
**
kwargs
)
**
kwargs
)
self
.
dropout
=
nn
.
Dropout
(
dropout
)
self
.
dropout
=
nn
.
Dropout
(
dropout
)
self
.
init_cfg
=
init_cfg
def
forward
(
self
,
def
forward
(
self
,
query
,
query
,
...
@@ -171,7 +170,6 @@ class FFN(BaseModule):
...
@@ -171,7 +170,6 @@ class FFN(BaseModule):
self
.
num_fcs
=
num_fcs
self
.
num_fcs
=
num_fcs
self
.
act_cfg
=
act_cfg
self
.
act_cfg
=
act_cfg
self
.
dropout
=
dropout
self
.
dropout
=
dropout
self
.
init_cfg
=
init_cfg
self
.
activate
=
build_activation_layer
(
act_cfg
)
self
.
activate
=
build_activation_layer
(
act_cfg
)
layers
=
[]
layers
=
[]
...
@@ -422,7 +420,6 @@ class TransformerLayerSequence(BaseModule):
...
@@ -422,7 +420,6 @@ class TransformerLayerSequence(BaseModule):
else
:
else
:
assert
isinstance
(
transformerlayers
,
list
)
and
\
assert
isinstance
(
transformerlayers
,
list
)
and
\
len
(
transformerlayers
)
==
num_layers
len
(
transformerlayers
)
==
num_layers
self
.
init_cfg
=
init_cfg
self
.
num_layers
=
num_layers
self
.
num_layers
=
num_layers
operation_order
=
transformerlayers
[
0
][
'operation_order'
]
operation_order
=
transformerlayers
[
0
][
'operation_order'
]
self
.
pre_norm
=
operation_order
[
0
]
==
'norm'
self
.
pre_norm
=
operation_order
[
0
]
==
'norm'
...
...
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