Fix for tf.keras.regularizers.{l1,l2}(0.) with tf.get_variable
This fix tries to address the issue in 22470 where
tf.keras.regularizers.{l1,l2}(l=0.) with tf.get_variable returns
```
AttributeError: 'float' object has no attribute 'name'
```
The issue only happens when `l=0.` as in that case, `regularization = 0.`
was returned directly (and `0.` does not have a `name` attribute as a float number)
This fix convert regularization = 0. to tensor.
This fix fixes 22470.
Signed-off-by:
Yong Tang <yong.tang.github@outlook.com>
Loading
Please sign in to comment