def _quantization_annotation(lhs_prec, rhs_prec,
                             rhs_is_weight):
  """Returns an annotation to be appended to the name of the quantizable op."""
  bfloat16_prec = 'bf16'

  def _replace_with_bf16_if_prec_is_none(prec):
    return prec if prec is not None else bfloat16_prec

  lhs_prec = _replace_with_bf16_if_prec_is_none(lhs_prec)
  rhs_prec = _replace_with_bf16_if_prec_is_none(rhs_prec)

  quant_annotation = '_lhs{}_rhs{}_lw{}'.format(lhs_prec, rhs_prec,
                                                int(rhs_is_weight))
  return quant_annotation