Tail Batch Sampling: Approximating Global Contrastive Losses as Optimization over Batch Assignments