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

Method get

caffe2/python/context.py:42–46  ·  view source on GitHub ↗
(self, cls)

Source from the content-addressed store, hash-verified

40 self._ctxs = {}
41
42 def get(self, cls):
43 if cls not in self._ctxs:
44 assert issubclass(cls, Managed), "must be a context managed class, got {}".format(cls)
45 self._ctxs[cls] = _ContextInfo(cls, allow_default=issubclass(cls, DefaultManaged))
46 return self._ctxs[cls]
47
48
49_CONTEXT_REGISTRY = _ContextRegistry()

Callers 3

currentMethod · 0.45
__enter__Method · 0.45
__exit__Method · 0.45

Calls 2

_ContextInfoClass · 0.85
formatMethod · 0.45

Tested by

no test coverage detected