Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/pytorch/pytorch
/ exit
Method
exit
caffe2/python/context.py:24–26 ·
view source on GitHub ↗
(self, value)
Source
from the content-addressed store, hash-verified
22
self._stack.append(value)
23
24
def
exit(self, value):
25
assert len(self._stack) > 0,
'Context %s is empty.'
% self.cls
26
assert self._stack.pop() == value
27
28
def
get_active(self, required=True):
29
if
len(self._stack) == 0:
Callers
1
__exit__
Method · 0.45
Calls
1
pop
Method · 0.45
Tested by
no test coverage detected