1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

remove some rand functions

* make test more reproducible
This commit is contained in:
Tomoaki Teshima
2017-07-20 22:43:11 +09:00
parent dcb3c4ff1e
commit e63d628677
5 changed files with 11 additions and 23 deletions
+2 -1
View File
@@ -612,10 +612,11 @@ TEST_P(Eltwise, Accuracy)
eltwiseParam.set("operation", op);
if (op == "sum" && weighted)
{
RNG rng = cv::theRNG();
std::vector<float> coeff(1 + numConv);
for (int i = 0; i < coeff.size(); ++i)
{
coeff[i] = ((float)rand() / RAND_MAX) * 4 - 2;
coeff[i] = rng.uniform(-2.0f, 2.0f);
}
eltwiseParam.set("coeff", DictValue::arrayReal<float*>(&coeff[0], coeff.size()));
}