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
e2b5a392
"vscode:/vscode.git/clone" did not exist on "dd390835cadf6ce591d69616e926a06baaf9e4eb"
Commit
e2b5a392
authored
Dec 08, 2022
by
charlie
Browse files
Fix add/subtract opt dimensions
parent
d176196b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/shape.cpp
src/shape.cpp
+3
-3
test/op_shape_test.cpp
test/op_shape_test.cpp
+2
-2
No files found.
src/shape.cpp
View file @
e2b5a392
...
...
@@ -531,7 +531,7 @@ bool operator!=(const std::size_t& x, const shape::dynamic_dimension& y) { retur
shape
::
dynamic_dimension
operator
+
(
const
shape
::
dynamic_dimension
&
x
,
const
std
::
size_t
&
y
)
{
return
{
x
.
min
+
y
,
x
.
max
+
y
,
x
.
opt
+
y
};
return
{
x
.
min
+
y
,
x
.
max
+
y
,
x
.
opt
==
0
?
0
:
x
.
opt
+
y
};
}
shape
::
dynamic_dimension
operator
+
(
const
std
::
size_t
&
x
,
const
shape
::
dynamic_dimension
&
y
)
{
...
...
@@ -539,11 +539,11 @@ shape::dynamic_dimension operator+(const std::size_t& x, const shape::dynamic_di
}
shape
::
dynamic_dimension
operator
-
(
const
shape
::
dynamic_dimension
&
x
,
const
std
::
size_t
&
y
)
{
return
{
x
.
min
-
y
,
x
.
max
-
y
,
x
.
opt
-
y
};
return
{
x
.
min
-
y
,
x
.
max
-
y
,
x
.
opt
==
0
?
0
:
x
.
opt
-
y
};
}
shape
::
dynamic_dimension
operator
-
(
const
std
::
size_t
&
x
,
const
shape
::
dynamic_dimension
&
y
)
{
return
{
x
-
y
.
min
,
x
-
y
.
max
,
x
-
y
.
opt
};
return
{
x
-
y
.
min
,
x
-
y
.
max
,
y
.
opt
==
0
?
0
:
x
-
y
.
opt
};
}
bool
operator
==
(
const
shape
&
x
,
const
shape
&
y
)
...
...
test/op_shape_test.cpp
View file @
e2b5a392
...
...
@@ -1680,9 +1680,9 @@ TEST_CASE(pad_shape1)
TEST_CASE
(
pad_dyn_shape0
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
3
,
3
,
0
},
{
3
,
3
,
0
}}};
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
3
,
5
,
0
},
{
3
,
5
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
5
,
5
,
0
},
{
5
,
5
,
0
}}};
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
5
,
7
,
0
},
{
5
,
7
,
0
}}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}),
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