MCPcopy Index your code
hub / github.com/NVIDIA/TensorRT-LLM / test_module

Method test_module

tests/unittest/others/test_module.py:73–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

71class TestModule(unittest.TestCase):
72
73 def test_module(self):
74 m = Module3()
75 print(m)
76 m.forward()
77
78 self.assertEqual(4, len(list(m.named_modules())))
79 self.assertEqual(5, len(list(m.named_network_outputs())))
80 self.assertEqual(
81 [("", m), ("m1", m.m1), ("m1.m1", m.m1.m1), ("m1.m2", m.m1.m2)],
82 list(m.named_modules()),
83 )
84 self.assertEqual(
85 [("", m, None), ("m1", m.m1, m), ("m1.m1", m.m1.m1, m.m1),
86 ("m1.m2", m.m1.m2, m.m1)],
87 list(m.named_modules_with_parent()),
88 )
89
90 def test_module_list(self):
91 m = Module4()

Callers

nothing calls this directly

Calls 5

forwardMethod · 0.95
Module3Class · 0.85
named_modulesMethod · 0.80
named_network_outputsMethod · 0.80

Tested by

no test coverage detected