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

Function _GetColocationNames

tensorflow/python/framework/importer.py:290–304  ·  view source on GitHub ↗

Returns names of the ops that `op` should be colocated with.

(op)

Source from the content-addressed store, hash-verified

288
289
290def _GetColocationNames(op):
291 """Returns names of the ops that `op` should be colocated with."""
292 colocation_names = []
293 try:
294 class_values = op.get_attr('_class')
295 except ValueError:
296 # No _class attr
297 return
298 for val in class_values:
299 val = compat.as_str(val)
300 if val.startswith('loc:@'):
301 colocation_node_name = val[len('loc:@'):]
302 if colocation_node_name != op.name:
303 colocation_names.append(colocation_node_name)
304 return colocation_names
305
306
307def _GatherReturnElements(requested_return_elements, graph, results):

Callers 1

_ProcessNewOpsFunction · 0.85

Calls 2

get_attrMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected