3.3.5. unit_scaling.constraints.to_grad_input_scale

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

Assumes two provided scales: (output_scale, grad_input_scale). Selects only grad_input_scale as the chosen scaling factor.

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

  • grad_input_scale (float) – the scale of the op’s input gradient

Returns:

equal to grad_input_scale

Return type:

float