Skip to content

Commit f275762

Browse files
jereliuedward-bot
authored andcommitted
[Sage/Uncertainty] Extend uncertainty experiment scripts to add GP layer support.
PiperOrigin-RevId: 332725773
1 parent ee83c00 commit f275762

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

edward2/tensorflow/layers/random_feature.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ def __init__(self,
185185
def build(self, input_shape):
186186
gp_feature_dim = input_shape[-1]
187187

188+
# Convert gp_feature_dim to int value for TF1 compatibility.
189+
if isinstance(gp_feature_dim, tf.compat.v1.Dimension):
190+
gp_feature_dim = gp_feature_dim.value
191+
188192
# Posterior precision matrix for the GP' random feature coefficients.
189193
self.precision_matrix = (
190194
self.add_weight(

0 commit comments

Comments
 (0)