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

Righto, tried what I think you’re aiming at… and it doesn’t work, so I’m surely doing something wrong…

Is this how you’d suggest using it? Editing the gist above (994x_mre_copula_with_jcd · GitHub)

with pm.Model(coords=coords, coords_mutable=coords_m) as mdl:
...
    # 7. Jacobian adjustment for observed data
    y_c_y_vals_list = mdl.replace_rvs_by_values([y_c, y])
    _ = pm.Potential('pot_jcd_y_c_on_y', get_log_jcd(*y_c_y_vals_list), dims='oid')

Seems to break the gradient calculations when I ask it to

with mdl:
    initial_points, step = pm.init_nuts(init='auto', chains=1)

Another tell is pm.model_graph.model_to_graphviz(mdl, formatting='plain') fails with a MissingInputError