Right now, the framework forces every layer to do the following to get the corresponding output scaling factors:
fn quantize_op<S: ScalingStrategy>(
self,
data: &S::AuxData,
node_id: NodeId,
input_scaling: &[ScalingFactor],
) -> anyhow::Result<QuantizeOutput<Self::QuantizedOp>> {
let mut output_scalings = S::scaling_factors_for_node(data, node_id, 1);
ensure!(
output_scalings.len() == 1,
"Output scaling for convolution layer different from 1"
);
...
The process could be streamlined if we directly give the output scaling factors as well, since the trait ScalingStrategy can only be used for that anyway.
Right now, the framework forces every layer to do the following to get the corresponding output scaling factors:
The process could be streamlined if we directly give the output scaling factors as well, since the trait
ScalingStrategycan only be used for that anyway.