Skip to content

Commit 7aa2f5d

Browse files
authored
Merge pull request #1336 from tensorflow/brianwa84-patch-3
Update distribution_layer.py
2 parents 2eba9ac + 74c6b0e commit 7aa2f5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tensorflow_probability/python/layers/distribution_layer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@
6868
'VariationalGaussianProcess',
6969
]
7070

71-
72-
tf.keras.__internal__.utils.register_symbolic_tensor_type(dtc._TensorCoercible) # pylint: disable=protected-access
71+
try:
72+
k_u = tf.keras.__internal__.utils
73+
except:
74+
from keras.utils import tf_utils as k_u
75+
k_u.register_symbolic_tensor_type(dtc._TensorCoercible) # pylint: disable=protected-access
7376

7477

7578
def _event_size(event_shape, name=None):

0 commit comments

Comments
 (0)