This will indeed circumvent the error message, but it feels like this might cause the same effects the framework tries to prevent with the guard in setattr
An alternative is surely to rewrite the part in a custom DataLoader without ‘patching’ around in the framework itself.
However, I would be interested to know, why resetting the Samplers was forbidden in the first place?