Skip to content

Commit 04f32d5

Browse files
LukeWoodtensorflow-copybara
authored andcommitted
Update nsl/research/carls to no longer rely on keras 1D->2D data upranking. We are planning to remove this behavior from the keras codebase. We are fixing various broken tests to minimize the impact of this breaking change.
PiperOrigin-RevId: 385853308
1 parent 345b8d6 commit 04f32d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

research/carls/graph_regularization.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ def call(self, inputs, training=False, **kwargs):
120120
# Invoke the call() function of the neighbor features layer directly instead
121121
# of invoking it as a callable to avoid Keras from wrapping placeholder
122122
# tensors with the tf.identity() op.
123+
124+
for feature_name, feature_value in inputs.items():
125+
if len(feature_value.shape) < 2:
126+
inputs[feature_name] = tf.expand_dims(feature_value, axis=-1)
127+
123128
sample_features, nbr_features, nbr_weights = self.nbr_features_layer.call(
124129
inputs)
125130
base_output = self._infer_and_update(

0 commit comments

Comments
 (0)