3.3.6. unit_scaling.constraints.to_left_grad_scale

unit_scaling.constraints.to_left_grad_scale(output_scale: float, left_grad_scale: float, right_grad_scale: float) float[source]

Assumes three provided scales: (output_scale, left_grad_scale, right_grad_scale). Selects only left_grad_scale as the chosen scaling factor.

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

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

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

Returns:

equal to left_grad_scale

Return type:

float