From 3f42fbad2e42cf03c01eb0428b06e24f4ad2d427 Mon Sep 17 00:00:00 2001 From: Ran Gal <79867742+galran@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:54:38 -0800 Subject: [PATCH] deleted the unused random_device variables because they caused a warning that was treated like an error. (#18543) deleted the unused random_device variables because they caused a warning that was treated like an error. **_Please check if the declaration is required for the random number generation. if so, there need to be a dummy reference to the variable or turning off the warning as error behavior._** ### Description ### Motivation and Context --- orttraining/orttraining/test/gradient/optimizer_ops_test.cc | 2 -- .../test/training_ops/cpu/reduction/reduction_ops_test.cc | 1 - 2 files changed, 3 deletions(-) diff --git a/orttraining/orttraining/test/gradient/optimizer_ops_test.cc b/orttraining/orttraining/test/gradient/optimizer_ops_test.cc index c100730aacc44..bfb59f1525e47 100644 --- a/orttraining/orttraining/test/gradient/optimizer_ops_test.cc +++ b/orttraining/orttraining/test/gradient/optimizer_ops_test.cc @@ -1542,7 +1542,6 @@ TEST(OptimizerTest, LambOptimizerTestLarge) { std::vector m(size); std::vector v(size); - std::random_device random_device; std::mt19937 random_engine(0); std::uniform_real_distribution dist(0.1f, 1.0f); for (int i = 0; i < size; ++i) { @@ -1581,7 +1580,6 @@ TEST(OptimizerTest, LambOptimizerTestLarge) { TEST(OptimizerTest, LambOptimizerMultiTensorRatio) { constexpr int group_count = 127; - std::random_device random_device; std::mt19937 random_engine(0); std::uniform_real_distribution dist(0.1f, 1.0f); std::uniform_int_distribution dist_int(1, 1228); diff --git a/orttraining/orttraining/test/training_ops/cpu/reduction/reduction_ops_test.cc b/orttraining/orttraining/test/training_ops/cpu/reduction/reduction_ops_test.cc index be8b0aaa0bce1..60c3ecbcce8ce 100644 --- a/orttraining/orttraining/test/training_ops/cpu/reduction/reduction_ops_test.cc +++ b/orttraining/orttraining/test/training_ops/cpu/reduction/reduction_ops_test.cc @@ -275,7 +275,6 @@ void TestMultiTensorReduce( test.SetDeterminism(use_determinism); // Set up random number generator. - std::random_device random_device; std::mt19937 random_engine(0); std::uniform_real_distribution dist(min, max); std::uniform_int_distribution dist_int(min_tensor_size, max_tensor_size);