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
86cf29ed
Commit
86cf29ed
authored
Dec 28, 2022
by
charlie
Browse files
Formatting
parent
8ad792f6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
src/include/migraphx/op/reshape.hpp
src/include/migraphx/op/reshape.hpp
+1
-1
test/op_shape_test.cpp
test/op_shape_test.cpp
+10
-6
No files found.
src/include/migraphx/op/reshape.hpp
View file @
86cf29ed
test/op_shape_test.cpp
View file @
86cf29ed
...
...
@@ -1986,9 +1986,10 @@ TEST_CASE(reshape_shape)
TEST_CASE
(
reshape_dyn_shape
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
1
,
1
,
0
},
{
1
,
1
,
0
}}};
for
(
auto
&&
new_shape
:
std
::
vector
<
std
::
vector
<
int64_t
>>
{{
-
1
,
1
,
1
,
24
},
{
0
,
8
,
3
,
1
},
{
-
1
,
3
,
4
,
2
},
{
0
,
2
,
4
,
3
}})
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
1
,
1
,
0
},
{
1
,
1
,
0
}}};
for
(
auto
&&
new_shape
:
std
::
vector
<
std
::
vector
<
int64_t
>>
{
{
-
1
,
1
,
1
,
24
},
{
0
,
8
,
3
,
1
},
{
-
1
,
3
,
4
,
2
},
{
0
,
2
,
4
,
3
}})
{
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
out_dyn_dims
{};
for
(
std
::
size_t
i
=
0
;
i
<
new_shape
.
size
();
++
i
)
...
...
@@ -2010,21 +2011,24 @@ TEST_CASE(reshape_dyn_shape)
TEST_CASE
(
reshape_multiple_non_fixed_error
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
10
,
20
,
0
},
{
1
,
1
,
0
}}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
10
,
20
,
0
},
{
1
,
1
,
0
}}};
std
::
vector
<
int64_t
>
new_shape
=
{
0
,
1
,
0
,
24
};
throws_shape
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
new_shape
}}),
input
);
}
TEST_CASE
(
reshape_fixed_ele_not_matching_error
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
10
,
10
,
0
},
{
1
,
1
,
0
}}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
10
,
10
,
0
},
{
1
,
1
,
0
}}};
std
::
vector
<
int64_t
>
new_shape
=
{
0
,
1
,
5
,
24
};
throws_shape
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
new_shape
}}),
input
);
}
TEST_CASE
(
reshape_non_fixed_not_matching_error
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
1
,
1
,
0
},
{
1
,
1
,
0
}}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
24
,
24
,
0
},
{
1
,
1
,
0
},
{
1
,
1
,
0
}}};
std
::
vector
<
int64_t
>
new_shape
=
{
2
,
1
,
1
,
24
};
throws_shape
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
new_shape
}}),
input
);
}
...
...
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