Is there any way I could get bit value of my weight

I quantize my model and I want the bit value of all weights in my model. But I don’t how to do it

Could you elaborate on what you mean by bit value of the weights?
If you would like to access quantized weights you can try <quantized_module>.weight(). This returns a quantized tensor of weights and you can use int_repr() to get the int8_t values of weights.

Based on your advice, when I try to print the weight of the quantized model, I get FP32 weights, scaling, and zero_point, but I can’t get the int weight?

yeah you can try:


to get the int weight, for more details about quantized tensor apis, please see: