Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
f4f9d711
Commit
f4f9d711
authored
Aug 25, 2023
by
Brian Pickrell
Browse files
update random_uniform_and_seed_test
parent
c102f09b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+2
-10
No files found.
test/ref_ops_test.cpp
View file @
f4f9d711
...
@@ -6573,7 +6573,6 @@ TEST_CASE(random_uniform_and_seed_test)
...
@@ -6573,7 +6573,6 @@ TEST_CASE(random_uniform_and_seed_test)
migraphx::program p;
migraphx::program p;
auto* mm = p.get_main_module();
auto* mm = p.get_main_module();
float control_seed = 0.0f;
size_t sample_size(20000);
size_t sample_size(20000);
// Shape of the random data
// Shape of the random data
...
@@ -6592,15 +6591,8 @@ TEST_CASE(random_uniform_and_seed_test)
...
@@ -6592,15 +6591,8 @@ TEST_CASE(random_uniform_and_seed_test)
params0["Input_1"] = migraphx::argument(input_fixed_shape1);
params0["Input_1"] = migraphx::argument(input_fixed_shape1);
auto result = p.eval(params0).back();
auto result = p.eval(params0).back();
std::vector<float> result_vec(sample_size);
result.visit([&](auto output) { EXPECT(output.size() == sample_size); });
result.visit([&](auto output) { result_vec.assign(output.begin(), output.end()); });
// Do not check the content of the data since it's not repeatable
// Compare result with the STL's mt19937 generator. Expected verify_range error ~0.4
std::mt19937 gen(control_seed);
std::uniform_real_distribution<> dis(0.0, 1.0);
std::vector<float> rand_samples(sample_size);
std::generate(rand_samples.begin(), rand_samples.end(), [&]() { return dis(gen); });
EXPECT(migraphx::verify::verify_range(result_vec, rand_samples, 1.e8));
}
}
TEST_CASE(random_seed_test)
TEST_CASE(random_seed_test)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment