Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
74fb919a
Unverified
Commit
74fb919a
authored
Oct 31, 2023
by
Charlie Lin
Committed by
GitHub
Oct 31, 2023
Browse files
Fix allocate 0 arg version (#2388)
parent
22bb777f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/include/migraphx/op/allocate.hpp
src/include/migraphx/op/allocate.hpp
+2
-4
test/op_shape_test.cpp
test/op_shape_test.cpp
+3
-2
No files found.
src/include/migraphx/op/allocate.hpp
View file @
74fb919a
...
...
@@ -37,6 +37,8 @@ namespace op {
* Static allocate:
* No inputs: `allocate()`
* `this.s` attribute set to the static output shape of the buffer.
* `this.s` attribute can be set to a dynamic output shape; however this will allocate the maximum
* buffer size for that case
*
* Dynamic allocate:
* One input: `allocate(output_dims)`
...
...
@@ -74,10 +76,6 @@ struct allocate
}
else
{
if
(
s
->
dynamic
())
{
MIGRAPHX_THROW
(
"ALLOCATE: dynamic shape attribute and no input"
);
}
migraphx
::
check_shapes
{
inputs
,
*
this
,
false
}.
has
(
0
);
}
return
s
.
value
();
...
...
test/op_shape_test.cpp
View file @
74fb919a
...
...
@@ -116,11 +116,12 @@ TEST_CASE(allocate_dyn_with_shape_attr)
input
);
}
TEST_CASE
(
allocate_dyn_no_input
_error
)
TEST_CASE
(
allocate_dyn_no_input
)
{
migraphx
::
shape
shape_attr
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
},
{
3
,
3
},
{
4
,
8
,
{
4
,
6
}},
{
4
,
8
},
{
4
,
6
}}};
throws_shape
(
migraphx
::
make_op
(
"allocate"
,
{{
"shape"
,
migraphx
::
to_value
(
shape_attr
)}}));
expect_shape
(
shape_attr
,
migraphx
::
make_op
(
"allocate"
,
{{
"shape"
,
migraphx
::
to_value
(
shape_attr
)}}));
}
TEST_CASE
(
allocate_shape_and_buf_type_error
)
...
...
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