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

Method test_multi

test/jit/test_script_profile.py:64–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 self.assertNotEqual(fn().dump_string(), "")
63
64 def test_multi(self):
65 seq = torch.jit.script(Sequence())
66 profiles = [torch.jit._ScriptProfile() for _ in range(5)]
67 for p in profiles:
68 p.enable()
69
70 last = None
71 while len(profiles) > 0:
72 seq(torch.rand((10, 10)))
73 p = profiles.pop()
74 p.disable()
75 stats = p.dump_string()
76 self.assertNotEqual(stats, "")
77 if last:
78 self.assertNotEqual(stats, last)
79 last = stats
80
81 def test_section(self):
82 seq = Sequence()

Callers

nothing calls this directly

Calls 9

seqFunction · 0.85
assertNotEqualMethod · 0.80
SequenceClass · 0.70
rangeFunction · 0.50
enableMethod · 0.45
randMethod · 0.45
popMethod · 0.45
disableMethod · 0.45
dump_stringMethod · 0.45

Tested by

no test coverage detected