code: def test_scalarloop_grad_mixed_dtypes(op, scalar_loop_grads):
      nin = op.nin
      for types in itertools.product(
          (float32, float64, int32), repeat=nin
      ):
          inputs = [type() for type in types]
          out = op(*inputs)
          wrt = [
              inp
              for idx, inp in enumerate(inputs)
              if idx in scalar_loop_grads
              and inp.type.dtype.startswith("float")
          ]
          if not wrt:
              continue
          # The ScalarLoop in the graph will fail if the input types are different from the updates
          grad = pt.grad(out, wrt=wrt)
          assert any(
              (var.owner and isinstance(var.owner.op, ScalarLoop))
              for var in ancestors(grad)
          )
  
imports: import itertools
  import numpy
  import pytest
  import scipy.special
  import pytensor.tensor
  from pytensor import function
  from pytensor.compile.mode import Mode
  from pytensor.graph import ancestors
  from pytensor.graph.fg import FunctionGraph
  from pytensor.link.c.basic import CLinker
  from pytensor.scalar import ScalarLoop, float32, float64, int32
  from pytensor.scalar.math import betainc, betainc_grad, gammainc, gammaincc, gammal, gammau, hyp2f1
  from tests.link.test_link import make_function
label_desc: Use image node_id 9 for calling a global function with example usage: test_scalarloop_grad_mixed_dtypes(op, scalar_loop_grads) without return types