LSQuantization icon indicating copy to clipboard operation
LSQuantization copied to clipboard

About Qmodes

Open Siamw opened this issue 4 years ago • 2 comments

how can i use kernel-wise quantization ? (Qmodes) Does it work at your code?

Siamw avatar Nov 01 '21 08:11 Siamw

There is currently no support, but you can add kernel-wise LSQ as follows:

w_reshape = self.weight.reshape([self.weight.shape[0], -1]).transpose(0, 1)
# quantize w_reshape
# ...
w_q = w_reshape_q.transpose(0, 1).reshape(self.weight.shape).detach() + self.weight - self.weight.detach()

hustzxd avatar Nov 01 '21 13:11 hustzxd

thanks! :D

Siamw avatar Nov 02 '21 00:11 Siamw