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

Method _add_device_to_stack

tensorflow/python/framework/ops.py:4320–4325  ·  view source on GitHub ↗

Add device to stack manually, separate from a context manager.

(self, device_name_or_function, offset=0)

Source from the content-addressed store, hash-verified

4318 self._colocation_stack = current_stack
4319
4320 def _add_device_to_stack(self, device_name_or_function, offset=0):
4321 """Add device to stack manually, separate from a context manager."""
4322 total_offset = 1 + offset
4323 spec = _UserDeviceSpec(device_name_or_function)
4324 self._device_function_stack.push_obj(spec, offset=total_offset)
4325 return spec
4326
4327 @tf_contextlib.contextmanager
4328 def device(self, device_name_or_function):

Callers 2

deviceMethod · 0.95
inner_cmMethod · 0.80

Calls 2

_UserDeviceSpecClass · 0.85
push_objMethod · 0.80

Tested by

no test coverage detected