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
7433c2d3
Commit
7433c2d3
authored
May 12, 2023
by
Ted Themistokleous
Browse files
save debug
parent
e1de8391
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
test/verify/test_gathernd_1d.cpp
test/verify/test_gathernd_1d.cpp
+32
-5
No files found.
test/verify/test_gathernd_1d.cpp
View file @
7433c2d3
...
@@ -32,12 +32,39 @@ struct test_gathernd_1d : verify_program<test_gathernd_1d>
...
@@ -32,12 +32,39 @@ struct test_gathernd_1d : verify_program<test_gathernd_1d>
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
ds
{
migraphx
::
shape
::
float_type
,
{
23670000
,
1
}};
migraphx
::
shape
is
{
migraphx
::
shape
::
int64_type
,
{
23670000
,
1
}};
migraphx
::
shape
ds
{
migraphx
::
shape
::
float_type
,
{
90000
,
264
}};
std
::
vector
<
int64_t
>
indices
(
23670000
,
0
);
auto
a0
=
mm
->
add_parameter
(
"data"
,
ds
);
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
;
return
p
;
}
}
};
};
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