code: def _test_binary(binary_op, x_range, y_range):
      xi = int8("xi")
      yi = int8("yi")
      xf = float32("xf")
      yf = float32("yf")
  
      ei = binary_op(xi, yi)
      fi = pytensor.function([xi, yi], ei)
  
      ef = binary_op(xf, yf)
      ff = pytensor.function([xf, yf], ef)
  
      for x_val in x_range:
          for y_val in y_range:
              outi = fi(x_val, y_val)
              outf = ff(x_val, y_val)
  
              assert outi.dtype == outf.dtype, "incorrect dtype"
              assert np.allclose(outi, outf), "insufficient precision"
  
imports: import numpy
  import pytest
  import pytensor
  import pytensor.tensor
  import tests.unittest_tools
  from pytensor.compile.mode import Mode
  from pytensor.graph.fg import FunctionGraph
  from pytensor.link.c.basic import DualLinker
  from pytensor.scalar.basic import ComplexError, Composite, InRange, ScalarType, add, and_, arccos, arccosh, arcsin, arcsinh, arctan, arctan2, arctanh, cast, complex64, constant, cos, cosh, deg2rad, eq, exp, exp2, expm1, float16, float32, floats, int8, int32, ints, invert, log, log1p, log2, log10, mean, mul, neq, rad2deg, reciprocal, sin, sinh, sqrt, switch, tan, tanh, true_div, uint8
  from pytensor.tensor.type import fscalar, imatrix, iscalar, matrix
  from tests.link.test_link import make_function
label_desc: Use image node_id 2 for calling the TestUpgradeToFloat obj's underlying member method code with example usage: obj._test_binary(binary_op, x_range, y_range) without return types