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

Method __exit__

tensorflow/python/eager/context.py:1526–1533  ·  view source on GitHub ↗
(self, *ex_info)

Source from the content-addressed store, hash-verified

1524 self._stack.append((old_device_name, old_device_spec, new_device_spec))
1525
1526 def __exit__(self, *ex_info):
1527 ctx = self._ctx
1528 old_device_name, old_device_spec, new_device_spec = self._stack[-1]
1529 if ctx.device_spec is not new_device_spec:
1530 raise RuntimeError(
1531 "Exiting device scope without proper scope nesting")
1532 del self._stack[-1]
1533 ctx._set_device(old_device_name, old_device_spec) # pylint: disable=protected-access
1534
1535
1536# Do not set directly. Use _set_context.

Callers

nothing calls this directly

Calls 1

_set_deviceMethod · 0.45

Tested by

no test coverage detected