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
93c89587
Commit
93c89587
authored
Dec 13, 2023
by
Paul
Browse files
Split onnx tests
parent
d2532d0e
Changes
490
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
408 additions
and
0 deletions
+408
-0
test/onnx/parse/lpnormalization_axis_error_test.cpp
test/onnx/parse/lpnormalization_axis_error_test.cpp
+10
-0
test/onnx/parse/lpnormalization_default_test.cpp
test/onnx/parse/lpnormalization_default_test.cpp
+35
-0
test/onnx/parse/lpnormalization_p_error_test.cpp
test/onnx/parse/lpnormalization_p_error_test.cpp
+10
-0
test/onnx/parse/lppool_l1_test.cpp
test/onnx/parse/lppool_l1_test.cpp
+23
-0
test/onnx/parse/lppool_l2_test.cpp
test/onnx/parse/lppool_l2_test.cpp
+23
-0
test/onnx/parse/lrn_test.cpp
test/onnx/parse/lrn_test.cpp
+22
-0
test/onnx/parse/main.cpp
test/onnx/parse/main.cpp
+4
-0
test/onnx/parse/matmul_bmbm_test.cpp
test/onnx/parse/matmul_bmbm_test.cpp
+22
-0
test/onnx/parse/matmul_bmv_test.cpp
test/onnx/parse/matmul_bmv_test.cpp
+24
-0
test/onnx/parse/matmul_dyn_broadcast_error.cpp
test/onnx/parse/matmul_dyn_broadcast_error.cpp
+12
-0
test/onnx/parse/matmul_dyn_mm_test.cpp
test/onnx/parse/matmul_dyn_mm_test.cpp
+25
-0
test/onnx/parse/matmul_dyn_mv_test.cpp
test/onnx/parse/matmul_dyn_mv_test.cpp
+25
-0
test/onnx/parse/matmul_dyn_vm_test.cpp
test/onnx/parse/matmul_dyn_vm_test.cpp
+25
-0
test/onnx/parse/matmul_dyn_vv_test.cpp
test/onnx/parse/matmul_dyn_vv_test.cpp
+28
-0
test/onnx/parse/matmul_mv_test.cpp
test/onnx/parse/matmul_mv_test.cpp
+21
-0
test/onnx/parse/matmul_vbm_test.cpp
test/onnx/parse/matmul_vbm_test.cpp
+24
-0
test/onnx/parse/matmul_vm_test.cpp
test/onnx/parse/matmul_vm_test.cpp
+21
-0
test/onnx/parse/matmul_vv_test.cpp
test/onnx/parse/matmul_vv_test.cpp
+24
-0
test/onnx/parse/matmulinteger_dyn_error.cpp
test/onnx/parse/matmulinteger_dyn_error.cpp
+12
-0
test/onnx/parse/matmulinteger_test.cpp
test/onnx/parse/matmulinteger_test.cpp
+18
-0
No files found.
test/onnx/parse/lpnormalization_axis_error_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
TEST_CASE
(
lpnormalization_axis_error_test
)
{
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"lpnormalization_axis_error_test.onnx"
);
}));
}
test/onnx/parse/lpnormalization_default_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
TEST_CASE
(
lpnormalization_default_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
std
::
vector
<
std
::
size_t
>
input_lens
{
3
,
4
};
auto
input_type
=
migraphx
::
shape
::
float_type
;
migraphx
::
shape
s
{
input_type
,
input_lens
};
auto
x
=
mm
->
add_parameter
(
"x"
,
s
);
std
::
ptrdiff_t
axis
=
0
;
auto
p_val
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"mul"
),
x
,
x
);
auto
norms
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"reduce_sum"
,
{{
"axes"
,
{
axis
}}}),
p_val
);
norms
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"sqrt"
),
norms
);
norms
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
input_lens
}}),
norms
);
auto
zero_mb
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
input_lens
}}),
mm
->
add_literal
(
migraphx
::
literal
{
migraphx
::
shape
{
input_type
},
{
0.
}}));
auto
one_mb
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
input_lens
}}),
mm
->
add_literal
(
migraphx
::
literal
{
migraphx
::
shape
{
input_type
},
{
1.
}}));
auto
is_zero
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"equal"
),
norms
,
zero_mb
);
auto
norms_zeros_to_one
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"where"
),
is_zero
,
one_mb
,
norms
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"div"
),
x
,
norms_zeros_to_one
);
auto
prog
=
optimize_onnx
(
"lpnormalization_default_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/lpnormalization_p_error_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
TEST_CASE
(
lpnormalization_p_error_test
)
{
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"lpnormalization_p_error_test.onnx"
);
}));
}
test/onnx/parse/lppool_l1_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/op/pooling.hpp>
TEST_CASE
(
lppool_l1_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
5
}});
mm
->
add_instruction
(
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
lpnorm
},
{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
}},
{
"lengths"
,
{
3
}},
{
"dilations"
,
{
1
}},
{
"lp_order"
,
1
}}),
l0
);
auto
prog
=
optimize_onnx
(
"lppool_l1_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/lppool_l2_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/op/pooling.hpp>
TEST_CASE
(
lppool_l2_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
5
}});
mm
->
add_instruction
(
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
lpnorm
},
{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
}},
{
"lengths"
,
{
3
}},
{
"dilations"
,
{
1
}},
{
"lp_order"
,
2
}}),
l0
);
auto
prog
=
optimize_onnx
(
"lppool_l2_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/lrn_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/op/lrn.hpp>
TEST_CASE
(
lrn_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
28
,
24
,
24
}});
migraphx
::
op
::
lrn
op
;
op
.
size
=
5
;
op
.
alpha
=
0.0001
;
op
.
beta
=
0.75
;
op
.
bias
=
1.0
;
mm
->
add_instruction
(
op
,
l0
);
auto
prog
=
optimize_onnx
(
"lrn_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/main.cpp
0 → 100644
View file @
93c89587
#include <test.hpp>
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
test/onnx/parse/matmul_bmbm_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_bmbm_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
6
,
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
5
,
2
,
1
,
7
,
8
}});
auto
bl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
5
,
2
,
3
,
6
,
7
}}}),
l0
);
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
5
,
2
,
3
,
7
,
8
}}}),
l1
);
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
bl0
,
bl1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
auto
prog
=
optimize_onnx
(
"matmul_bmbm_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_bmv_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_bmv_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
6
,
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l1
);
auto
bsl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
3
,
7
,
1
}}}),
sl1
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
l0
,
bsl1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
2
}}}),
res
);
auto
prog
=
optimize_onnx
(
"matmul_bmv_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_dyn_broadcast_error.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
TEST_CASE
(
matmul_dyn_broadcast_error
)
{
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
4
};
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"matmul_dyn_broadcast_error.onnx"
,
options
);
}));
}
test/onnx/parse/matmul_dyn_mm_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_dyn_mm_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
4
,
8
,
{
6
}},
{
7
,
7
}}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
7
,
7
},
{
1
,
5
,
{
3
}}}});
auto
ret
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
l0
,
l1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
map_dyn_input_dims
[
"1"
]
=
{{
4
,
8
,
{
6
}},
{
7
,
7
}};
options
.
map_dyn_input_dims
[
"2"
]
=
{{
7
,
7
},
{
1
,
5
,
{
3
}}};
auto
prog
=
parse_onnx
(
"matmul_dyn_mm_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_dyn_mv_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_dyn_mv_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
4
,
8
,
{
6
}},
{
7
,
7
}}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l1
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
l0
,
sl1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
auto
ret
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
1
}}}),
res
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
map_dyn_input_dims
[
"1"
]
=
{{
4
,
8
,
{
6
}},
{
7
,
7
}};
auto
prog
=
parse_onnx
(
"matmul_dyn_mv_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_dyn_vm_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_dyn_vm_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
7
,
7
},
{
4
,
10
,
{
8
}}}});
auto
sl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l0
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
sl0
,
l1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
auto
ret
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
0
}}}),
res
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
map_dyn_input_dims
[
"2"
]
=
{{
7
,
7
},
{
4
,
10
,
{
8
}}};
auto
prog
=
parse_onnx
(
"matmul_dyn_vm_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_dyn_vv_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_dyn_vv_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
::
dynamic_dimension
dd
{
5
,
8
,
{
7
}};
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
dd
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
dd
}});
auto
sl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l0
);
auto
sl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l1
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
sl0
,
sl1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
auto
sr0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
0
}}}),
res
);
auto
ret
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
0
}}}),
sr0
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
dd
;
auto
prog
=
parse_onnx
(
"matmul_dyn_vv_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_mv_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_mv_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
6
,
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l1
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
l0
,
sl1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
1
}}}),
res
);
auto
prog
=
optimize_onnx
(
"matmul_mv_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_vbm_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_vbm_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
5
,
7
,
8
}});
auto
sl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l0
);
auto
bsl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
5
,
1
,
7
}}}),
sl0
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
bsl0
,
l1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
1
}}}),
res
);
auto
prog
=
optimize_onnx
(
"matmul_vbm_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_vm_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_vm_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
,
8
}});
auto
sl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l0
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
sl0
,
l1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
0
}}}),
res
);
auto
prog
=
optimize_onnx
(
"matmul_vm_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmul_vv_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
#include <migraphx/apply_alpha_beta.hpp>
TEST_CASE
(
matmul_vv_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l0
);
auto
sl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l1
);
auto
res
=
migraphx
::
add_apply_alpha_beta
(
*
mm
,
{
sl0
,
sl1
},
migraphx
::
make_op
(
"dot"
),
1.0
f
,
0.0
f
);
auto
sr0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
0
}}}),
res
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
0
}}}),
sr0
);
auto
prog
=
optimize_onnx
(
"matmul_vv_test.onnx"
);
EXPECT
(
p
==
prog
);
}
test/onnx/parse/matmulinteger_dyn_error.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
TEST_CASE
(
matmulinteger_dyn_error
)
{
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
4
};
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"matmulinteger_dyn_error.onnx"
,
options
);
}));
}
test/onnx/parse/matmulinteger_test.cpp
0 → 100644
View file @
93c89587
#include <onnx_test.hpp>
TEST_CASE
(
matmulinteger_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
int8_type
,
{
3
,
6
,
16
}});
auto
l1
=
mm
->
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
int8_type
,
{
3
,
16
,
8
}});
mm
->
add_instruction
(
migraphx
::
make_op
(
"quant_dot"
),
l0
,
l1
);
auto
prog
=
optimize_onnx
(
"matmulinteger_test.onnx"
);
EXPECT
(
p
==
prog
);
}
Prev
1
…
9
10
11
12
13
14
15
16
17
…
25
Next
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