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
babd7b1a
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "305f41e4dea99d9fdc212287263b3748aacc63d3"
Unverified
Commit
babd7b1a
authored
Jun 29, 2022
by
Michal Szutenberg
Committed by
GitHub
Jun 29, 2022
Browse files
Remove DT_DOUBLE from the T5 graph (#17891)
parent
6aae59d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/t5/modeling_tf_t5.py
src/transformers/models/t5/modeling_tf_t5.py
+1
-1
No files found.
src/transformers/models/t5/modeling_tf_t5.py
View file @
babd7b1a
...
@@ -268,7 +268,7 @@ class TFT5Attention(tf.keras.layers.Layer):
...
@@ -268,7 +268,7 @@ class TFT5Attention(tf.keras.layers.Layer):
max_exact
=
num_buckets
//
2
max_exact
=
num_buckets
//
2
is_small
=
tf
.
math
.
less
(
relative_position
,
max_exact
)
is_small
=
tf
.
math
.
less
(
relative_position
,
max_exact
)
relative_position_if_large
=
max_exact
+
tf
.
cast
(
relative_position_if_large
=
max_exact
+
tf
.
cast
(
tf
.
math
.
log
(
relative_position
/
max_exact
)
tf
.
math
.
log
(
tf
.
cast
(
relative_position
,
tf
.
float32
)
/
tf
.
cast
(
max_exact
,
tf
.
float32
)
)
/
math
.
log
(
max_distance
/
max_exact
)
/
math
.
log
(
max_distance
/
max_exact
)
*
(
num_buckets
-
max_exact
),
*
(
num_buckets
-
max_exact
),
dtype
=
relative_position
.
dtype
,
dtype
=
relative_position
.
dtype
,
...
...
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