MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / QuantLeNet

Class QuantLeNet

tools/pytorch-quantization/tests/fixtures/models.py:45–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45class QuantLeNet(nn.Module):
46 def __init__(self, **kwargs):
47 super(QuantLeNet, self).__init__()
48 self.conv1 = QuantConv2d(1, 10, kernel_size=5, **kwargs)
49 self.conv2 = QuantConv2d(10, 20, kernel_size=5, **kwargs)
50 self.fc1 = QuantLinear(320, 50, **kwargs)
51 self.fc2 = QuantLinear(50, 10, **kwargs)
52
53 def forward(self, x):
54 x = F.relu(F.max_pool2d(self.conv1(x), 2))
55 x = F.relu(F.max_pool2d(self.conv2(x), 2))
56 x = x.view(-1, 320)
57 x = F.relu(self.fc1(x))
58 x = F.dropout(x, training=self.training)
59 x = self.fc2(x)
60 return F.log_softmax(x, dim=1)
61
62@pytest.fixture
63def resnet18():

Callers 14

test_simple_buildMethod · 0.90
test_forwardMethod · 0.90
test_backwardMethod · 0.90
test_native_amp_fp16Method · 0.90
test_calibrationMethod · 0.90
test_maxMethod · 0.90
test_shape_with_axisMethod · 0.90
test_percentileMethod · 0.90
test_mseMethod · 0.90
test_mse_with_axisMethod · 0.90

Calls

no outgoing calls

Tested by 13

test_simple_buildMethod · 0.72
test_forwardMethod · 0.72
test_backwardMethod · 0.72
test_native_amp_fp16Method · 0.72
test_calibrationMethod · 0.72
test_maxMethod · 0.72
test_shape_with_axisMethod · 0.72
test_percentileMethod · 0.72
test_mseMethod · 0.72
test_mse_with_axisMethod · 0.72