I just tried the suggestion above it gives an error:
ValueError: Random variables detected in the logp graph: {normal_rv{0, (0, 0), floatX, False}.out}.
This can happen when DensityDist logp or Interval transform functions reference nonlocal variables,
or when not all rvs have a corresponding value variable.
But would be better if @ricardoV94 confirms that his suggestions is still the only way and random streams cant be used for this purpose.