Commit 455d488f authored by Brian Pickrell's avatar Brian Pickrell
Browse files

fix test bug in compute()

parent 2ef739bd
......@@ -31,7 +31,7 @@
*
* Inputs: (1) randomization seed (uint32)
* (2) the shape of the set to be populated.
*
*
*
* Attributes: none
*
......@@ -91,10 +91,11 @@ struct rand_uniform
}
}
argument compute(const shape& output, std::vector<argument>& args) const
argument compute(const shape& output, std::vector<argument> args) const
{
(void)output;
argument& result{args[1]};
// Output goes into the passed buffer, not the shape output
(void) output;
argument result{args[1].get_shape()};
uint32_t local_seed = args[0].at<uint32_t>(0);
......@@ -105,7 +106,7 @@ struct rand_uniform
});
return result;
}
std::ptrdiff_t output_alias(const std::vector<shape>&) const { return 1; }
};
......
......@@ -6508,12 +6508,7 @@ TEST_CASE(rand_uniform_dyn_test)
migraphx::shape seed_shape{migraphx::shape::uint32_type, {1}};
auto seed_input = mm->add_parameter("Seed", seed_shape);
mm->add_instruction(migraphx::make_op("rand_uniform",
{
{"seed", seed + 1},
}),
input,
seed_input);
mm->add_instruction(migraphx::make_op("rand_uniform", {}), seed_input, input);
p.compile(migraphx::make_target("ref"));
// Create a dummy input to hold the random data
......@@ -6550,7 +6545,7 @@ TEST_CASE(rand_uniform_and_seed_test)
// Runtime randomization seed
auto seed_input = mm->add_instruction(migraphx::make_op("random_seed"));
mm->add_instruction(migraphx::make_op("rand_uniform"), input, seed_input);
mm->add_instruction(migraphx::make_op("rand_uniform"), seed_input, input);
p.compile(migraphx::make_target("ref"));
// Create a dummy input to hold the random data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment