Add device to stack manually, separate from a context manager.
(self, device_name_or_function, offset=0)
| 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): |
no test coverage detected