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
1ab8dc44
Unverified
Commit
1ab8dc44
authored
Nov 29, 2019
by
Thomas Wolf
Committed by
GitHub
Nov 29, 2019
Browse files
Merge pull request #1876 from huggingface/mean-fix
Mean does not exist in TF2
parents
f0d22b63
3de31f8d
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 @
1ab8dc44
...
...
@@ -460,7 +460,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