MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _serialize_object_graph

Function _serialize_object_graph

tensorflow/python/saved_model/save.py:613–630  ·  view source on GitHub ↗

Save a SavedObjectGraph proto for `root`.

(saveable_view, asset_file_def_index)

Source from the content-addressed store, hash-verified

611
612
613def _serialize_object_graph(saveable_view, asset_file_def_index):
614 """Save a SavedObjectGraph proto for `root`."""
615 # SavedObjectGraph is similar to the TrackableObjectGraph proto in the
616 # checkpoint. It will eventually go into the SavedModel.
617 proto = saved_object_graph_pb2.SavedObjectGraph()
618 saveable_view.fill_object_graph_proto(proto)
619
620 coder = nested_structure_coder.StructureCoder()
621 for concrete_function in saveable_view.concrete_functions:
622 serialized = function_serialization.serialize_concrete_function(
623 concrete_function, saveable_view.captured_tensor_node_ids, coder)
624 if serialized is not None:
625 proto.concrete_functions[concrete_function.name].CopyFrom(
626 serialized)
627
628 for obj, obj_proto in zip(saveable_view.nodes, proto.nodes):
629 _write_object_proto(obj, obj_proto, asset_file_def_index)
630 return proto
631
632
633def _write_object_proto(obj, proto, asset_file_def_index):

Callers 1

saveFunction · 0.85

Calls 3

_write_object_protoFunction · 0.85
CopyFromMethod · 0.45

Tested by

no test coverage detected