"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "305f41e4dea99d9fdc212287263b3748aacc63d3"
Unverified Commit babd7b1a authored by Michal Szutenberg's avatar Michal Szutenberg Committed by GitHub
Browse files

Remove DT_DOUBLE from the T5 graph (#17891)

parent 6aae59d0
...@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment