tests : avoid creating RNGs for each Q tensor
ggml-ci
This commit is contained in:
parent
b7ddc8bf12
commit
8eb8fd94e2
1 changed files with 2 additions and 4 deletions
|
@ -60,10 +60,8 @@ static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float m
|
||||||
const float * im = imatrix.data();
|
const float * im = imatrix.data();
|
||||||
if (!ggml_quantize_requires_imatrix(tensor->type)) {
|
if (!ggml_quantize_requires_imatrix(tensor->type)) {
|
||||||
// when the imatrix is optional, we want to test both quantization with and without imatrix
|
// when the imatrix is optional, we want to test both quantization with and without imatrix
|
||||||
std::random_device rd;
|
// use one of the random numbers to decide
|
||||||
std::default_random_engine generator(rd());
|
if (data[0] > 0.5f*(min + max)) {
|
||||||
std::uniform_int_distribution<int> distribution(0, 1);
|
|
||||||
if (distribution(generator)) {
|
|
||||||
im = nullptr;
|
im = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue