Commit c475edf9 authored by Yong Tang's avatar Yong Tang
Browse files

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: default avatarYong Tang <yong.tang.github@outlook.com>
parent 646b3c23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment