3.3.7. unit_scaling.constraints.to_output_scale

unit_scaling.constraints.to_output_scale(output_scale: float, *grad_input_scale: float) float[source]

Assumes an output scale is provided and any number of grad input scales: (output_scale, *grad_input_scales). Selects only output_scale as the chosen scaling factor.

Parameters:
  • output_scale (float) – the scale of the op’s output

  • grad_input_scales (*float) – the scales of the op’s input gradients

Returns:

equal to output_scale

Return type:

float