Thanks for pointing this out.
If I’m not mistaken, both linked tutorials use the second approach (which would work, since no custom sampler is used).
I’m not sure, if your suggestions would work in all use cases, e.g. using a batch_sampler.
However, I haven’t thought about all edge cases.