code: def test_amp_precision_scaler_with_bf16():
      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
  
file_path: pytorch-lightning/tests/tests_fabric/plugins/precision/test_amp.py
imports: import re
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric.plugins.precision.amp import MixedPrecision
label_desc: Use image node_id 2 for calling a global function with example usage: test_amp_precision_scaler_with_bf16() without return types