def simclr_collate_fn(samples):
    'Multi-crop collate function for VISSL integration.\n\n    Run custom collate on a single key since VISSL transforms affect only DefaultDataKeys.INPUT\n    '
    result = vissl_collate_helper(samples)
    inputs = []
    num_views = len(samples[0][DefaultDataKeys.INPUT])
    view_idx = 0
    while (view_idx < num_views):
        for batch_ele in samples:
            imgs = batch_ele[DefaultDataKeys.INPUT]
            inputs.append(imgs[view_idx])
        view_idx += 1
    result[DefaultDataKeys.INPUT] = torch.stack(inputs)
    return result
Multi-crop collate function for VISSL integration.

Run custom collate on a single key since VISSL transforms affect only DefaultDataKeys.INPUT
def simclr_collate_fn(samples):
    'Multi-crop collate function for VISSL integration.\n\n    Run custom collate on a single key since VISSL transforms affect only DefaultDataKeys.INPUT\n    '
    result = vissl_collate_helper(samples)
    inputs = []
    num_views = len(samples[0][DefaultDataKeys.INPUT])
    view_idx = 0
    while (view_idx < num_views):
        for batch_ele in samples:
            imgs = batch_ele[DefaultDataKeys.INPUT]
            inputs.append(imgs[view_idx])
        view_idx += 1
    result[DefaultDataKeys.INPUT] = torch.stack(inputs)
    return result