mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-24 18:23:01 +00:00
LayerConvNeXtGamma: fix for mixed precision mode
This commit is contained in:
parent
a630db2c49
commit
1a8f10339a
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ class LayerConvNeXtGamma(tf.keras.layers.Layer):
|
|||
super(LayerConvNeXtGamma, self).__init__(name=name)
|
||||
|
||||
self.dim = dim
|
||||
self.const = const_val * tf.ones((self.dim))
|
||||
self.const = const_val * tf.ones((self.dim), dtype=tf.float32 if tf.mixed_precision.global_policy().name == "float32" else tf.float16)
|
||||
|
||||
def call(self, inputs, **kwargs):
|
||||
return tf.multiply(inputs, self.const)
|
||||
|
|
Loading…
Reference in a new issue