ANT_Micro22
ANT_Micro22 copied to clipboard
could you explain a bit more about flint_value()
https://github.com/clevercool/ANT_Micro22/blob/main/ant_quantization/antquant/quant_modules.py#L245
if B = 6 with signed bit, value bit is 5, then neg_exp_num is 4, and the i rangs [0, 5), so exp_bit would be 6 when i is 4, but the total bit is 6, in such case, value_bit is 5, so the mant_bit would be -1, I think it is so confusing, could you explain a bit more?
for i in range(0, neg_exp_num + 1):
exp_bit = i + 2
exp_value = -(exp_bit - 1)
mant_bit = value_bit - exp_bit
for j in range(int(2 ** mant_bit)):
v = 2 ** exp_value * (1 + 2 ** (-mant_bit) * j)
values.append(v)
if self.is_signed:
values.append(-v)