Something changed in `pytensor > 2.12.3` (and thus `pymc > 5.6.1`) that makes my `pytensor.gradient.grad` call get stuck - any ideas?

Interesting… maybe I’ve misunderstood a concept here - and/or am simply trying something unusual by transforming data

The specific model is in this gist here (994_mre_copula_with_jcd Scenario 1 (Old World): Use `pymc 5.6.1, pytensor 2.12.3` · GitHub) (also linked in my first question above).

In this model I believe I need to apply the Jacobian adjustment to the RV y_c which is the result of transforming observed marginal data y n observations, 2 marginals, shape (n, 2) via a lognormal_cdf and then a normal_icdf. So y_c is also shape (n, 2).

...
# 3. Transform Observed Y to Uniform through marginal CDFs
y_u = pm.Deterministic('y_u', pt.exp(pm.logcdf(m_d, y)), dims=('oid', 'y_u_nm'))

# 4. Transform Uniformed Y to an Empirical Copula via MvN InvCDF
#    to be later evidenced against our latent MvN copula RVs
y_c = pm.Deterministic('y_c', normal_icdf(y_u), dims=('oid', 'y_c_nm'))
...

So this seems like a different situation to transforming unobserved RVs in for example, this gist: (991_mre_jacobiandet_issue.ipynb · GitHub) which is the port of Bob Carpenter’s example that I posted before.

I’ll try the stacked system approach and report back