code: def test_callbacks_convergence(diff, ord):
      cb = pm.variational.callbacks.CheckParametersConvergence(
          every=1, diff=diff, ord=ord
      )
  
      class _approx:
          params = (pytensor.shared(np.asarray([1, 2, 3])),)
  
      approx = _approx()
  
      with pytest.raises(StopIteration):
          cb(approx, None, 1)
          cb(approx, None, 10)
  
imports: import numpy
  import pytensor
  import pytest
  import pymc
label_desc: Use image node_id 1 for calling a global function with example usage: test_callbacks_convergence(diff, ord) without return types