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
3de31f8d
Commit
3de31f8d
authored
Nov 19, 2019
by
Lysandre
Browse files
mean does not exist in TF2
parent
f3386d93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
transformers/modeling_tf_utils.py
transformers/modeling_tf_utils.py
+1
-1
No files found.
transformers/modeling_tf_utils.py
View file @
3de31f8d
...
...
@@ -454,7 +454,7 @@ class TFSequenceSummary(tf.keras.layers.Layer):
elif
self
.
summary_type
==
'first'
:
output
=
hidden_states
[:,
0
]
elif
self
.
summary_type
==
'mean'
:
output
=
tf
.
mean
(
hidden_states
,
axis
=
1
)
output
=
tf
.
reduce_
mean
(
hidden_states
,
axis
=
1
)
elif
self
.
summary_type
==
'cls_index'
:
hidden_shape
=
shape_list
(
hidden_states
)
# e.g. [batch, num choices, seq length, hidden dims]
if
cls_index
is
None
:
...
...
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