I did just catch this bug: It comes from the `make_compute_graph` which causes a self loop ```python from pymc.model_graph import ModelGraph coords = { "obs": range(5), } with pm.Model(coords=coords) as model: data = pt.as_tensor_variable( np.ones((5, 3)), name="C", ) pm.Deterministic("C", data, dims=("obs", None)) error_compute_graph = ModelGraph(model).make_compute_graph() # defaultdict(set, {"C": {"C"}}) # Visualize error: pm.model_to_graphviz(model) ``` Result:  _Originally posted by @wd60622 in https://github.com/pymc-devs/pymc/issues/7392#issuecomment-2196586849_