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

Method _get_tensor_from_node

tensorflow/python/saved_model/load.py:201–216  ·  view source on GitHub ↗

Resolves a node id into a tensor to be captured for a function.

(self, node_id)

Source from the content-addressed store, hash-verified

199 concrete_function.graph.capture(bound_input)
200
201 def _get_tensor_from_node(self, node_id):
202 """Resolves a node id into a tensor to be captured for a function."""
203 with ops.init_scope():
204 obj = self._nodes[node_id]
205 if ds_values.is_distributed_variable(obj):
206 return obj
207 elif resource_variable_ops.is_resource_variable(obj):
208 return obj.handle
209 elif isinstance(obj, tracking.TrackableAsset):
210 return obj.asset_path
211 elif tensor_util.is_tensor(obj):
212 return obj
213 elif isinstance(obj, tracking.CapturableResource):
214 # Note: this executes restored functions in the CapturableResource.
215 return obj.resource_handle
216 raise ValueError("Can't convert node %s to tensor" % (type(obj)))
217
218 def _load_all(self):
219 """Load all saved objects and wire their properties."""

Callers 1

Calls 2

typeFunction · 0.85
is_tensorMethod · 0.80

Tested by

no test coverage detected