28
28
REFERENCE_SCALES = {
29
29
'int_quant' : (0.00935234408825635910 , 0.01362917013466358185 ),
30
30
'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 ]])
32
34
33
35
34
36
def compute_quantile (x , q ):
@@ -86,9 +88,7 @@ class TestModel(nn.Module):
86
88
def __init__ (self ):
87
89
super (TestModel , self ).__init__ ()
88
90
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
92
92
self .act_1 = qnn .QuantIdentity (act_quant = act_quant )
93
93
94
94
def forward (self , x ):
@@ -97,7 +97,7 @@ def forward(self, x):
97
97
return self .act_1 (o )
98
98
99
99
# Reference input
100
- inp = REFERNECE_INP
100
+ inp = REFERENCE_INP
101
101
model = TestModel ()
102
102
model .eval ()
103
103
with torch .no_grad ():
0 commit comments