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

Function _get_handle_mover

tensorflow/python/ops/session_ops.py:271–289  ·  view source on GitHub ↗

Return a move subgraph for this pair of feeder and handle.

(graph, feeder, handle)

Source from the content-addressed store, hash-verified

269
270
271def _get_handle_mover(graph, feeder, handle):
272 """Return a move subgraph for this pair of feeder and handle."""
273 dtype = _get_handle_feeder(graph, feeder)
274 if dtype is None:
275 return None
276 handle_device = TensorHandle._get_device_name(handle)
277 if feeder.op.device == handle_device:
278 return None
279 # Now we know we have to move the tensor.
280 graph_key = TensorHandle._get_mover_key(feeder, handle)
281 result = graph._handle_movers.get(graph_key)
282 if result is None:
283 # Create mover if we haven't done it.
284 holder, reader = _get_handle_reader(graph, handle, dtype)
285 with graph.as_default(), graph.device(feeder.op.device):
286 mover = gen_data_flow_ops.get_session_handle(reader)
287 result = (holder, mover)
288 graph._handle_movers[graph_key] = result
289 return result
290
291
292def _get_handle_deleter(graph, deleter_key, handle):

Callers

nothing calls this directly

Calls 7

_get_handle_feederFunction · 0.85
_get_handle_readerFunction · 0.85
_get_device_nameMethod · 0.80
_get_mover_keyMethod · 0.80
getMethod · 0.45
as_defaultMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected