Skip to content

Commit 25b95fc

Browse files
committed
Formatting
1 parent a073264 commit 25b95fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/brevitas/graph/test_calibration.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
REFERENCE_SCALES = {
2929
'int_quant': (0.00935234408825635910, 0.01362917013466358185),
3030
'fp_quant': (0.00249395845457911491, 0.00363444536924362183)}
31-
REFERNECE_INP = torch.tensor([[-1.8645, -0.4071, 1.1971]])
31+
REFERENCE_INP = torch.tensor([[-1.8645, -0.4071, 1.1971]])
32+
REFERENCE_WEIGHTS = torch.tensor([[1.0023, 0.0205, 1.4604], [-0.2918, -1.8218, -0.7010],
33+
[1.4573, -0.9074, -0.2708]])
3234

3335

3436
def compute_quantile(x, q):
@@ -86,9 +88,7 @@ class TestModel(nn.Module):
8688
def __init__(self):
8789
super(TestModel, self).__init__()
8890
self.act = qnn.QuantReLU(act_quant=act_quant)
89-
self.linear_weights = torch.tensor([[1.0023, 0.0205,
90-
1.4604], [-0.2918, -1.8218, -0.7010],
91-
[1.4573, -0.9074, -0.2708]])
91+
self.linear_weights = REFERENCE_WEIGHTS
9292
self.act_1 = qnn.QuantIdentity(act_quant=act_quant)
9393

9494
def forward(self, x):
@@ -97,7 +97,7 @@ def forward(self, x):
9797
return self.act_1(o)
9898

9999
# Reference input
100-
inp = REFERNECE_INP
100+
inp = REFERENCE_INP
101101
model = TestModel()
102102
model.eval()
103103
with torch.no_grad():

0 commit comments

Comments
 (0)