qkeras.qtools.quantized_operators.multiplier_factory
Create multiplier quantizer.
Classes
determine which multiplier implementation to use. |
- class qkeras.qtools.quantized_operators.multiplier_factory.MultiplierFactory[source]
Bases:
objectdetermine which multiplier implementation to use.
- make_multiplier(weight_quantizer, input_quantizer)[source]
Create a multiplier instance.
The type and bit width of the multiplier is deteremined from the quantizer type of both the kernel (weight) and input tensor.
The table below illustrates the rule of inferring multiplier type from the quantizer type of both the kernel (weight) and input tensor
x
qb(n) +/-,exp t(-1,0,+1) b(-1,+1) b(0,1) float32
qb(n) * << >>,- ?,- ?,- ? +/-,exp << >>,- + ?,- ^ ?,-
- w t(-1,0,+1) ?,- ?,- ?,^ ?,^ ^
b(-1,+1) ?,- ^ ?,^ ^ ^ b(0,1) ? ?,- ^ ^ ^ & float32
- Parameters:
weight_quantizer (
IQuantizer) – weight quantizer typeinput_quantizer (
IQuantizer) – input quantizer type
- Return type:
- Returns:
An IMultiplier instance.