We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a08ff8 commit 471b5c1Copy full SHA for 471b5c1
official/vision/modeling/layers/nn_blocks.py
@@ -1564,9 +1564,7 @@ def build(self, inputs_shape):
1564
1565
def call(self, inputs, inputs_positions=None):
1566
del inputs_positions
1567
- input_dtype = inputs.dtype
1568
- gamma = self.gamma
1569
- return tf.cast(tf.cast(inputs, tf.float32) * gamma, input_dtype)
+ return tf.cast(self.gamma, inputs.dtype) * inputs
1570
1571
1572
@tf.keras.utils.register_keras_serializable(package='Vision')
0 commit comments