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
chenpangpang
transformers
Commits
c8b6ae85
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "b62ca59527de4e883fb8e91f02e97586115616b1"
Unverified
Commit
c8b6ae85
authored
Aug 11, 2022
by
amyeroberts
Committed by
GitHub
Aug 11, 2022
Browse files
Return the permuted hidden states if return_dict=True (#18578)
parent
f28f2408
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/models/convnext/modeling_tf_convnext.py
src/transformers/models/convnext/modeling_tf_convnext.py
+2
-1
No files found.
src/transformers/models/convnext/modeling_tf_convnext.py
View file @
c8b6ae85
...
@@ -330,7 +330,8 @@ class TFConvNextMainLayer(tf.keras.layers.Layer):
...
@@ -330,7 +330,8 @@ class TFConvNextMainLayer(tf.keras.layers.Layer):
hidden_states
=
tuple
([
tf
.
transpose
(
h
,
perm
=
(
0
,
3
,
1
,
2
))
for
h
in
encoder_outputs
[
1
]])
hidden_states
=
tuple
([
tf
.
transpose
(
h
,
perm
=
(
0
,
3
,
1
,
2
))
for
h
in
encoder_outputs
[
1
]])
if
not
return_dict
:
if
not
return_dict
:
return
(
last_hidden_state
,
pooled_output
)
+
encoder_outputs
[
1
:]
hidden_states
=
hidden_states
if
output_hidden_states
else
()
return
(
last_hidden_state
,
pooled_output
)
+
hidden_states
return
TFBaseModelOutputWithPooling
(
return
TFBaseModelOutputWithPooling
(
last_hidden_state
=
last_hidden_state
,
last_hidden_state
=
last_hidden_state
,
...
...
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