MCPcopy Create free account
hub / github.com/pytorch/tutorials / M

Class M

intermediate_source/torch_compile_conv_bn_fuser.py:51–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 return self.mod(x)
50
51class M(nn.Module):
52 def __init__(self):
53 super().__init__()
54 self.conv1 = nn.Conv2d(1, 1, 1)
55 self.bn1 = nn.BatchNorm2d(1)
56 self.conv2 = nn.Conv2d(1, 1, 1)
57 self.nested = nn.Sequential(
58 nn.BatchNorm2d(1),
59 nn.Conv2d(1, 1, 1),
60 )
61 self.wrapped = WrappedBatchNorm()
62
63 def forward(self, x):
64 x = self.conv1(x)
65 x = self.bn1(x)
66 x = self.conv2(x)
67 x = self.nested(x)
68 x = self.wrapped(x)
69 return x
70
71model = M().to(device)
72model.eval()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected