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

Class TestModel

exir/tests/test_print_program.py:17–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15class TestPrintProgram(unittest.TestCase):
16 def test_inspect_node(self) -> None:
17 class TestModel(torch.nn.Module):
18 def __init__(self):
19 super().__init__()
20 self.conv1 = torch.nn.Conv2d(32, 32, 1)
21 self.conv2 = torch.nn.Conv2d(32, 32, 1)
22 self.conv3 = torch.nn.Conv2d(32, 32, 1)
23 self.gelu = torch.nn.GELU()
24
25 def forward(self, x: torch.Tensor):
26 a = self.conv1(x)
27 b = self.conv2(a)
28 c = self.conv3(a + b)
29 return self.gelu(c)
30
31 class WrapModule(torch.nn.Module):
32 def __init__(self):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by 1

__init__Method · 0.56