code: def test_stan_grad_partial(self):
      # This test combines the following STAN tests:
      # https://github.com/stan-dev/math/blob/master/test/unit/math/prim/fun/inc_beta_dda_test.cpp
      # https://github.com/stan-dev/math/blob/master/test/unit/math/prim/fun/inc_beta_ddb_test.cpp
      # https://github.com/stan-dev/math/blob/master/test/unit/math/prim/fun/inc_beta_ddz_test.cpp
      a, b, z = pt.scalars("a", "b", "z")
      betainc_out = pt.betainc(a, b, z)
      betainc_grad = pt.grad(betainc_out, [a, b, z])
      f_grad = function([a, b, z], betainc_grad)
  
      decimal_precision = 7 if config.floatX == "float64" else 3
  
      for (
          test_a,
          test_b,
          test_z,
          expected_dda,
          expected_ddb,
          expected_ddz,
      ) in (
          (
              1.5,
              1.25,
              0.001,
              -0.00028665637,
              4.41357328e-05,
              0.063300692,
          ),
          (1.5, 1.25, 0.5, -0.26038693947, 0.29301795, 1.1905416),
          (1.5, 1.25, 0.6, -0.23806757, 0.32279575, 1.23341068),
          (1.5, 1.25, 0.999, -0.00022264493, 0.0018969609, 0.35587692),
          (15000, 1.25, 0.001, 0, 0, 0),
          (15000, 1.25, 0.5, 0, 0, 0),
          (15000, 1.25, 0.6, 0, 0, 0),
          (
              15000,
              1.25,
              0.999,
              -6.59543226e-10,
              2.00849793e-06,
              0.009898182,
          ),
          (
              1.5,
              12500,
              0.001,
              -3.93756641e-05,
              1.47821755e-09,
              0.1848717,
          ),
          (1.5, 12500, 0.5, 0, 0, 0),
          (1.5, 12500, 0.6, 0, 0, 0),
          (1.5, 12500, 0.999, 0, 0, 0),
          (15000, 12500, 0.001, 0, 0, 0),
          (
              15000,
              12500,
              0.5,
              -8.72102443e-53,
              9.55282792e-53,
              5.01131256e-48,
          ),
          (
              15000,
              12500,
              0.6,
              -4.085621e-14,
              -5.5067062e-14,
              1.15135267e-71,
          ),
          (15000, 12500, 0.999, 0, 0, 0),
      ):
          np.testing.assert_almost_equal(
              f_grad(test_a, test_b, test_z),
              [expected_dda, expected_ddb, expected_ddz],
              decimal=decimal_precision,
          )
  
imports: import warnings
  import numpy
  import pytest
  from pytensor.gradient import verify_grad
  from pytensor.scalar import ScalarLoop
  from pytensor.tensor.elemwise import Elemwise
  from functools import partial
  import scipy.special
  import scipy.stats
  from pytensor import function, grad
  from pytensor import tensor
  from pytensor.compile.mode import get_default_mode
  from pytensor.configdefaults import config
  from pytensor.tensor import gammaincc, inplace, vector
  from tests import unittest_tools
  from tests.tensor.utils import _good_broadcast_unary_chi2sf, _good_broadcast_unary_normal, _good_broadcast_unary_normal_float, _good_broadcast_unary_normal_float_no_complex, _good_broadcast_unary_normal_float_no_complex_small_neg_range, _good_broadcast_unary_normal_no_complex, _grad_broadcast_unary_0_2_no_complex, _grad_broadcast_unary_abs1_no_complex, _grad_broadcast_unary_normal, _grad_broadcast_unary_normal_small_neg_range, check_floatX, copymod, integers_ranged, makeBroadcastTester, random_ranged, upcast_int8_nfunc
label_desc: Use image node_id 1 for calling the TestBetaIncGrad obj's underlying member method code with example usage: obj.test_stan_grad_partial() without return types