We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我注意到IAO的quantizer中,weights的max_val被设置为 (1 << self.bits) - 2 ,而activation是(1 << self.bits) - 1)。不知道为什么这样设置,两者不应该都是255(8bit)吗?
class UnsignedQuantizer(Quantizer): def __init__(self, *args, **kwargs): super(UnsignedQuantizer, self).__init__(*args, **kwargs) if self.activation_weight_flag == 0: # weight self.register_buffer( "quant_min_val", torch.tensor((0), dtype=torch.float32) ) self.register_buffer( "quant_max_val", torch.tensor(((1 << self.bits) - 2), dtype=torch.float32), ) elif self.activation_weight_flag == 1: # activation self.register_buffer( "quant_min_val", torch.tensor((0), dtype=torch.float32) ) self.register_buffer( "quant_max_val", torch.tensor(((1 << self.bits) - 1), dtype=torch.float32), ) else: print("activation_weight_flag error")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
你好,我注意到IAO的quantizer中,weights的max_val被设置为 (1 << self.bits) - 2 ,而activation是(1 << self.bits) - 1)。不知道为什么这样设置,两者不应该都是255(8bit)吗?
The text was updated successfully, but these errors were encountered: