MCPcopy Index your code
hub / github.com/pytorch/pytorch / use_my_context

Method use_my_context

caffe2/python/context_test.py:21–28  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19
20class TestContext(test_util.TestCase):
21 def use_my_context(self):
22 try:
23 for _ in range(100):
24 with MyContext() as a:
25 for _ in range(100):
26 self.assertTrue(MyContext.current() == a)
27 except Exception as e:
28 self._exceptions.append(e)
29
30 def testMultiThreaded(self):
31 threads = []

Callers

nothing calls this directly

Calls 4

MyContextClass · 0.85
currentMethod · 0.80
rangeFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected