"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "8a41b244e8c65fe9b5a63e72370571a6494960b8"
Commit 8d0c7942 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 377422408
parent 297a4bbc
...@@ -28,4 +28,4 @@ def hard_sigmoid(features): ...@@ -28,4 +28,4 @@ def hard_sigmoid(features):
The activation value. The activation value.
""" """
features = tf.convert_to_tensor(features) features = tf.convert_to_tensor(features)
return tf.nn.relu6(features + tf.constant(3.)) * 0.16667 return tf.nn.relu6(features + tf.cast(3., features.dtype)) * 0.16667
...@@ -52,7 +52,8 @@ def hard_swish(features): ...@@ -52,7 +52,8 @@ def hard_swish(features):
The activation value. The activation value.
""" """
features = tf.convert_to_tensor(features) features = tf.convert_to_tensor(features)
return features * tf.nn.relu6(features + tf.constant(3.)) * (1. / 6.) fdtype = features.dtype
return features * tf.nn.relu6(features + tf.cast(3., fdtype)) * (1. / 6.)
@tf.keras.utils.register_keras_serializable(package='Text') @tf.keras.utils.register_keras_serializable(package='Text')
......
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