I suspect you’re using 1.8 and this change affects blocking :

Enable distribution validation by default for torch.distributions (#48743)
This may slightly slow down some models. Concerned users may disable validation by using torch.distributions.Distribution.set_default_validate_args(False) or by disabling individual distribution validation via MyDistribution(…, validate_args=False).

FYI, previous version doesn’t block in this snippet, unless validate_args=[“scale”] is added