Skip to content

Commit fb7c122

Browse files
samihaijatensorflower-gardener
authored andcommitted
Enable test case: subgraph sampling model, saving and loading, as tf.keras.Model.
PiperOrigin-RevId: 534966793
1 parent 6d84bbd commit fb7c122

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

tensorflow_gnn/experimental/in_memory/int_arithmetic_sampler_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def test_graph_sampler_constructor_without_edgesets_raises_exception(self):
368368

369369
@parameterized.named_parameters(
370370
('TFLoadSavedModel', 'TFLoadModel'),
371-
# ('KerasLoadSavedGModel', 'KerasLoadModel'), # blocked by cl/530981500
371+
('KerasLoadSavedGModel', 'KerasLoadModel'),
372372
('KerasModel', 'KerasModel')
373373
)
374374
def test_smoke_integration_sampling_pipeline_model(self, operation_mode):

tensorflow_gnn/experimental/sampler/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,9 @@ def get_config(self):
10301030
return dict(validate=self._validate, **super().get_config())
10311031

10321032
def call(self, inputs: GraphPieces) -> tfgnn.GraphTensor:
1033+
# When saving `tf.keras.Model`, the loaded model passes a tuple.
1034+
# Convert to namedtuple.
1035+
inputs = GraphPieces(*inputs)
10331036
context: Features = inputs.context
10341037
node_sets: Mapping[tfgnn.NodeSetName,
10351038
Union[Features, List[Features]]] = inputs.node_sets

0 commit comments

Comments
 (0)