Okay, I guess the solution is to aggregate all predictions and to calculate the dice-score over all results simultaniously.
I.e. instead of:
result = (dice_score(pred1,gt1) + dice_score(pred2,gt2)) / 2
do
result = dice_score(torch.cat([pred1, pred2, ...], dim=1), torch.cat([gt1, gt2, ...], dim=1))

EDIT
This of course could need huge amounts of RAM and compute, therefore better aggregate the intersection and union and calculate the dice-score in the end.