code: def test_joint_logp_incsubtensor(indices, size):
      """Make sure we can compute a log-likelihood for ``Y[idx] = data`` where ``Y`` is univariate."""
  
      mu = pm.floatX(np.power(10, np.arange(np.prod(size)))).reshape(
          size
      )
      data = mu[indices]
      sigma = 0.001
      rng = np.random.RandomState(232)
      a_val = rng.normal(mu, sigma, size=size).astype(
          pytensor.config.floatX
      )
  
      rng = pytensor.shared(rng, borrow=False)
      a = pm.Normal.dist(mu, sigma, size=size, rng=rng)
      a_value_var = a.type()
      a.name = "a"
  
      a_idx = pt.set_subtensor(a[indices], data)
  
      assert isinstance(
          a_idx.owner.op,
          (IncSubtensor, AdvancedIncSubtensor, AdvancedIncSubtensor1),
      )
  
      a_idx_value_var = a_idx.type()
      a_idx_value_var.name = "a_idx_value"
  
      a_idx_logp = transformed_conditional_logp(
          (a_idx,),
          rvs_to_values={a_idx: a_value_var},
          rvs_to_transforms={},
      )
  
      logp_vals = a_idx_logp[0].eval({a_value_var: a_val})
  
      # The indices that were set should all have the same log-likelihood values,
      # because the values they were set to correspond to the unique means along
      # that dimension.  This helps us confirm that the log-likelihood is
      # associating the assigned values with their correct parameters.
      a_val_idx = a_val.copy()
      a_val_idx[indices] = data
      exp_obs_logps = sp.norm.logpdf(a_val_idx, mu, sigma)
      np.testing.assert_almost_equal(logp_vals, exp_obs_logps)
  
imports: import warnings
  import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  import scipy.stats.distributions
  from pytensor.graph.basic import ancestors, equal_computations
  from pytensor.tensor.random.op import RandomVariable
  from pytensor.tensor.subtensor import AdvancedIncSubtensor, AdvancedIncSubtensor1, IncSubtensor
  import pymc
  from pymc.logprob.basic import conditional_logp, icdf, logcdf, logp, transformed_conditional_logp
  from pymc.logprob.transforms import LogTransform
  from pymc.logprob.utils import replace_rvs_by_values
  from pymc.testing import assert_no_rvs
label_desc: Use image node_id 9 for calling a global function with example usage: test_joint_logp_incsubtensor(indices, size) without return types