code: def _mixed_precision_is_enabled(hparams):
    
    activation_dtype = hparams.activation_dtype
    weight_dtype = hparams.weight_dtype
    return activation_dtype == tf.float16 and weight_dtype == tf.float32
docs: Should be the same as in common_attention, avoiding import.