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

Function _sort_key

tensorflow/python/tpu/tpu_system_metadata.py:134–137  ·  view source on GitHub ↗
(device)

Source from the content-addressed store, hash-verified

132 # We sort the metadata devices so that downstream users get a sorted list
133 # for creating mirrored variables correctly.
134 def _sort_key(device):
135 spec = tf_device.DeviceSpec.from_string(device.name)
136 return (spec.job, spec.replica, spec.task, spec.device_type,
137 spec.device_index)
138 devices = tuple(sorted(devices, key=_sort_key))
139
140 metadata = _TPUSystemMetadata(

Callers

nothing calls this directly

Calls 1

from_stringMethod · 0.80

Tested by

no test coverage detected