MCPcopy Create free account
hub / github.com/pytorch/executorch / test_smoke

Method test_smoke

runtime/test/test_runtime.py:23–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21
22class RuntimeTest(unittest.TestCase):
23 def test_smoke(self):
24 ep, inputs = create_program(ModuleAdd())
25 runtime = Runtime.get()
26 # Demonstrate that get() returns a singleton.
27 runtime2 = Runtime.get()
28 self.assertTrue(runtime is runtime2)
29 program = runtime.load_program(ep.buffer, verification=Verification.Minimal)
30 method = program.load_method("forward")
31 outputs = method.execute(inputs)
32 self.assertTrue(torch.allclose(outputs[0], inputs[0] + inputs[1]))
33
34 def test_module_with_multiple_method_names(self):
35 ep, inputs = create_program(ModuleMulti())

Callers

nothing calls this directly

Calls 6

create_programFunction · 0.90
ModuleAddClass · 0.90
load_programMethod · 0.80
load_methodMethod · 0.80
getMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected