To be clear, it’s totally equivalent to your suggested approach (computing the mean outside of the graph, using the raw data). It might be a teeny tiny bit more readable, because it’s happening “in the model”. But then on the other hand it requires you to understand what pytensor is doing. So in the end, it’s down to preference : )
@DrEntropy Thanks for the kind words, and for the great example. It shows very clearly what’s happening!