code: def test_updates_fast(opt, loss_and_params, kwargs, getter):
      with pytensor.config.change_flags(compute_test_value="ignore"):
          loss, param = getter(loss_and_params)
          args = dict()
          args.update(**kwargs)
          args.update(dict(loss_or_grads=loss, params=param))
          if loss is None and param is None:
              updates = opt(**args)
              # Here we should get new callable
              assert callable(updates)
              # And be able to get updates
              updates = opt(_b, [_a])
              assert isinstance(updates, dict)
          # case when both are None is above
          elif loss is None or param is None:
              # Here something goes wrong and user provides not full set of [params + loss_or_grads]
              # We raise Value error
              with pytest.raises(ValueError):
                  opt(**args)
          else:
              # Usual call to optimizer, old behaviour
              updates = opt(**args)
              assert isinstance(updates, dict)
  
imports: import numpy
  import pytensor
  import pytest
  from pymc.variational.updates import adadelta, adagrad, adagrad_window, adam, adamax, momentum, nesterov_momentum, rmsprop, sgd
label_desc: Use image node_id 1 for calling a global function with example usage: test_updates_fast(opt, loss_and_params, kwargs, getter) without return types