Skip to content

Commit

Permalink
deleted the unused random_device variables because they caused a warn…
Browse files Browse the repository at this point in the history
…ing 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
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
galran authored Nov 28, 2023
1 parent fc8631e commit 3f42fba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions orttraining/orttraining/test/gradient/optimizer_ops_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,6 @@ TEST(OptimizerTest, LambOptimizerTestLarge) {
std::vector<float> m(size);
std::vector<float> v(size);

std::random_device random_device;
std::mt19937 random_engine(0);
std::uniform_real_distribution<float> dist(0.1f, 1.0f);
for (int i = 0; i < size; ++i) {
Expand Down Expand Up @@ -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<float> dist(0.1f, 1.0f);
std::uniform_int_distribution<int64_t> dist_int(1, 1228);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<float> dist(min, max);
std::uniform_int_distribution<int64_t> dist_int(min_tensor_size, max_tensor_size);
Expand Down

0 comments on commit 3f42fba

Please sign in to comment.