MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TestNet

Class TestNet

imperative/python/test/unit/module/test_qat.py:42–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 kernel_size = 3
41
42 class TestNet(Module):
43 def __init__(self, groups, bias):
44 super().__init__()
45 self.quant = QuantStub()
46 self.dequant = DequantStub()
47 self.conv_bn = ConvBn2d(
48 in_channels, out_channels, kernel_size, groups=groups, bias=bias,
49 )
50
51 def forward(self, inp):
52 out = self.quant(inp)
53 out = self.conv_bn(out)
54 out = self.dequant(out)
55 return out
56
57 inputs = tensor(np.random.randn(4, in_channels, 32, 32).astype(np.float32))
58 for groups, bias in product([1, 4], [True, False]):

Callers 9

test_qat_convbn2dFunction · 0.85
test_qat_convFunction · 0.85
test_qat_linearbn1dFunction · 0.85
test_qat_linear_reluFunction · 0.85
test_qat_linear_bn_reluFunction · 0.85

Calls

no outgoing calls

Tested by 9

test_qat_convbn2dFunction · 0.68
test_qat_convFunction · 0.68
test_qat_linearbn1dFunction · 0.68
test_qat_linear_reluFunction · 0.68
test_qat_linear_bn_reluFunction · 0.68