Commit 7433c2d3 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

save debug

parent e1de8391
......@@ -32,12 +32,39 @@ struct test_gathernd_1d : verify_program<test_gathernd_1d>
{
migraphx::program p;
auto* mm = p.get_main_module();
migraphx::shape ds{migraphx::shape::float_type, {23670000, 1}};
migraphx::shape is{migraphx::shape::int64_type, {23670000, 1}};
std::vector<int64_t> indices(23670000, 0);
migraphx::shape ds{migraphx::shape::float_type, {90000, 264}};
auto a0 = mm->add_parameter("data", ds);
auto a1 = mm->add_literal(migraphx::literal{is, indices});
mm->add_instruction(migraphx::make_op("gathernd"), a0, a1);
migraphx::shape gs{migraphx::shape::float_type, {1}, {0}};
auto a3 = mm->add_literal(migraphx::literal{gs, {0.5}});
migraphx::shape neg1{migraphx::shape::int64_type, {1}, {1}};
auto lneg1 = mm->add_literal(migraphx::literal{neg1, {-1}});
//std::vector<int64_t> indices(23670000, 0);
//migraphx::shape is{migraphx::shape::int64_type, {23670000, 1}};
//auto a1 = mm->add_literal(migraphx::literal{is, indices});
auto sig_out = mm->add_instruction(migraphx::make_op("sigmoid"), a0);
//auto sig_sh = sig_out.get_shape();
//auto sig_lit = mm->add_literal(migraphx::literal{sig_sh, sig_sh->lget_shape().lens()});
//auto slice_o = mm->add_instruction(migraphx::make_op("slice"), sig_lit); //shape operator
//auto concat_o = mm->add_instruction(migraphx::make_op("concat"), slice_o, lneg1);
auto con_out = mm->add_instruction(migraphx::make_op("contiguous"), sig_out);
auto mult_b = mm->add_instruction(migraphx::make_op("multibroadcast", {{"out_lens", {23760000}}}), a3);
p.debug_print();
auto re_out = mm->add_instruction(migraphx::make_op("reshape", {{"dims", -1}}), con_out);
auto g_out = mm->add_instruction(migraphx::make_op("greater"), sig_out, mult_b);
auto conv_o = mm->add_instruction(migraphx::make_op("convert", {{"target_type", 0}}), g_out);
auto nonzout = mm->add_instruction(migraphx::make_op("nonzero"), conv_o);
auto trans_o = mm->add_instruction(migraphx::make_op("transpose"), nonzout);
p.debug_print();
mm->add_instruction(migraphx::make_op("gathernd"), sig_out, trans_o);
return p;
}
};
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