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

Function current

tensorflow/python/distribute/device_util.py:93–102  ·  view source on GitHub ↗

Return a string (not canonicalized) for the current device.

()

Source from the content-addressed store, hash-verified

91
92
93def current():
94 """Return a string (not canonicalized) for the current device."""
95 # TODO(josh11b): Work out how this function interacts with ops.colocate_with.
96 if ops.executing_eagerly_outside_functions():
97 d = context.context().device_name
98 else:
99 op = _FakeOperation()
100 ops.get_default_graph()._apply_device_functions(op) # pylint: disable=protected-access
101 d = op.device
102 return d
103
104
105def get_host_for_device(device):

Callers 1

resolveFunction · 0.85

Calls 3

_FakeOperationClass · 0.85
contextMethod · 0.45

Tested by

no test coverage detected