import torch


def shuffle_data(inputs, outputs):
    """Shuffle the first dimension of a set of input/output data"""
    n_examples = outputs.shape[0]
    shuffled_indices = torch.randperm(n_examples)
    inputs = inputs[shuffled_indices]
    outputs = outputs[shuffled_indices]
    return inputs, outputs