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
33be2634
Commit
33be2634
authored
Dec 27, 2022
by
charlie
Browse files
Add asserts
parent
e986fc57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
src/shape.cpp
src/shape.cpp
+11
-1
No files found.
src/shape.cpp
View file @
33be2634
...
@@ -539,7 +539,17 @@ shape::dynamic_dimension operator+(const std::size_t& x, const shape::dynamic_di
...
@@ -539,7 +539,17 @@ 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
)
shape
::
dynamic_dimension
operator
-
(
const
shape
::
dynamic_dimension
&
x
,
const
std
::
size_t
&
y
)
{
{
return
{
x
.
min
-
y
,
x
.
max
-
y
,
x
.
opt
==
0
?
0
:
x
.
opt
-
y
};
assert
(
x
.
min
>=
y
);
assert
(
x
.
max
>=
y
);
if
(
x
.
opt
==
0
)
{
return
{
x
.
min
-
y
,
x
.
max
-
y
,
0
};
}
else
{
assert
(
x
.
opt
>=
y
);
return
{
x
.
min
-
y
,
x
.
max
-
y
,
x
.
opt
-
y
};
}
}
}
bool
operator
==
(
const
shape
&
x
,
const
shape
&
y
)
bool
operator
==
(
const
shape
&
x
,
const
shape
&
y
)
...
...
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