Skip to content
Snippets Groups Projects
Commit 869a742b authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Add Random utils for random shuffling the batches

parent fc52f46f
No related branches found
No related tags found
2 merge requests!105version 0.2.0,!86Dataprovider iterator
Pipeline #39676 passed
......@@ -70,6 +70,7 @@
#include "aidge/utils/Attributes.hpp"
#include "aidge/utils/StaticAttributes.hpp"
#include "aidge/utils/DynamicAttributes.hpp"
#include "aidge/utils/Random.hpp"
#include "aidge/utils/Registrar.hpp"
#include "aidge/utils/Types.h"
......
/********************************************************************************
* Copyright (c) 2023 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#ifndef AIDGE_RANDOM_H_
#define AIDGE_RANDOM_H_
#include <algorithm>
#include <vector>
#include <random>
namespace Random {
void randShuffle(std::vector<unsigned int>& vec) {
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(vec.begin(), vec.end(), g);
}
}
#endif //AIDGE_RANDOM_H_
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment