Also a little additional problem: Changing the line where a is defined to a = pm.HalfNormal('a') to get a transformed variable, and then running datalogp_fn = testmodel.fastfn(testmodel.datalogpt), it raises an error saying TypeError: Unknown input or state: a. The function has 2 named inputs (a_log__, dataset). So it looks like now the resulting function also requires the observed data, in contrast to the function with the initial model that only required a.