From 8eb8fd94e2676213aa44054dd20cd91a70eed5be Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 16 Jan 2024 23:24:05 +0200 Subject: [PATCH] tests : avoid creating RNGs for each Q tensor ggml-ci --- tests/test-backend-ops.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index 417626fa1..40321415b 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -60,10 +60,8 @@ static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float m const float * im = imatrix.data(); if (!ggml_quantize_requires_imatrix(tensor->type)) { // when the imatrix is optional, we want to test both quantization with and without imatrix - std::random_device rd; - std::default_random_engine generator(rd()); - std::uniform_int_distribution distribution(0, 1); - if (distribution(generator)) { + // use one of the random numbers to decide + if (data[0] > 0.5f*(min + max)) { im = nullptr; } }