MCPcopy Create free account
hub / github.com/pytorch/pytorch / get_context

Method get_context

torch/_dynamo/code_context.py:13–18  ·  view source on GitHub ↗
(self, code: types.CodeType)

Source from the content-addressed store, hash-verified

11 return code in self.code_context
12
13 def get_context(self, code: types.CodeType):
14 ctx = self.code_context.get(code)
15 if ctx is None:
16 ctx = {}
17 self.code_context[code] = ctx
18 return ctx
19
20 def pop_context(self, code: types.CodeType):
21 ctx = self.get_context(code)

Callers 15

pop_contextMethod · 0.95
__init__Method · 0.80
initializeMethod · 0.80
process_poolMethod · 0.80
__call__Method · 0.80
create_call_resume_atMethod · 0.80
inline_call_Method · 0.80
create_proxyMethod · 0.80
_spawn_processesMethod · 0.80
start_processesFunction · 0.80
test_autograd_errorsMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 15

test_autograd_errorsMethod · 0.64
test_cuda_simpleMethod · 0.64
test_cuda_send_manyMethod · 0.64
test_eventMethod · 0.64