def normalize_arr(data, mean, std):
    """ Normalizes `data` by removing the mean and std parameters. """
    assert mean.shape == std.shape
    assert data.shape[-1:] == mean.shape

    return (data - mean) / std