def METHOD_NAME():
    with pytest.raises(ValueError, match="`precision='bf16-mixed'` does not use a scaler"):
        MixedPrecision(precision="bf16-mixed", device=Mock(), scaler=Mock())
    precision = MixedPrecision(precision="bf16-mixed", device=Mock())
    assert precision.scaler is None