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
14618b67
"vscode:/vscode.git/clone" did not exist on "59ce65c50fe89e1c61b86211683975d2a8cd4e44"
Commit
14618b67
authored
Mar 28, 2023
by
Ted Themistokleous
Browse files
Use generate for boxes and scores in tests
parent
514d616f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+3
-13
No files found.
test/ref_ops_test.cpp
View file @
14618b67
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <random>
#include <random>
#include <limits>
#include <limits>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/op/pooling.hpp>
#include <migraphx/op/pooling.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/quantization.hpp>
#include <migraphx/quantization.hpp>
...
@@ -5137,21 +5138,10 @@ TEST_CASE(nms_huge_test_random_data)
...
@@ -5137,21 +5138,10 @@ TEST_CASE(nms_huge_test_random_data)
unsigned long n = 31702968;
unsigned long n = 31702968;
migraphx::shape boxes_s{migraphx::shape::float_type, {n, 4}};
migraphx::shape boxes_s{migraphx::shape::float_type, {n, 4}};
std::vector<float> boxes_vec(4 * n);
migraphx::shape scores_s{migraphx::shape::float_type, {n}};
migraphx::shape scores_s{migraphx::shape::float_type, {n}};
std::vector<float> scores_vec(n);
size_t sample_size = 100000;
auto boxes_l = mm->add_literal(migraphx::generate_literal(boxes_s, 1337));
float seed = 0.0f;
auto scores_l = mm->add_literal(migraphx::generate_literal(scores_s, 1337));
std::mt19937 gen(seed);
std::uniform_real_distribution<> dis(0.0, 1.0);
std::vector<float> rand_samples(sample_size);
std::generate(boxes_vec.begin(), boxes_vec.end(), [&]() { return dis(gen); });
std::generate(scores_vec.begin(), scores_vec.end(), [&]() { return dis(gen); });
auto boxes_l = mm->add_literal(migraphx::literal(boxes_s, boxes_vec));
auto scores_l = mm->add_literal(migraphx::literal(scores_s, scores_vec));
auto max_out_l = mm->add_literal(migraphx::literal(
auto max_out_l = mm->add_literal(migraphx::literal(
migraphx::shape{migraphx::shape::int64_type, {1}}, {9223372036854775807}));
migraphx::shape{migraphx::shape::int64_type, {1}}, {9223372036854775807}));
auto iou_threshold = mm->add_literal(
auto iou_threshold = mm->add_literal(
...
...
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