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
768a5eca
Commit
768a5eca
authored
Apr 29, 2019
by
Khalique
Browse files
changed inheritance
parent
3e0b715a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/include/migraphx/op/clip.hpp
src/include/migraphx/op/clip.hpp
+8
-1
No files found.
src/include/migraphx/op/clip.hpp
View file @
768a5eca
...
@@ -18,12 +18,19 @@ namespace migraphx {
...
@@ -18,12 +18,19 @@ namespace migraphx {
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
op
{
namespace
op
{
struct
clip
:
unary
struct
clip
:
unary
<
clip
>
{
{
float
max_val
=
std
::
numeric_limits
<
float
>::
max
();
float
max_val
=
std
::
numeric_limits
<
float
>::
max
();
float
min_val
=
std
::
numeric_limits
<
float
>::
min
();
float
min_val
=
std
::
numeric_limits
<
float
>::
min
();
std
::
string
name
()
const
{
return
"clip"
;
}
std
::
string
name
()
const
{
return
"clip"
;
}
auto
apply
()
const
{
auto
&
max
=
max_val
;
auto
&
min
=
min_val
;
return
[
max
,
min
](
auto
x
)
{
return
x
>
min
?
(
x
<
max
?
x
:
max
)
:
min
;
};
}
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
static
auto
reflect
(
Self
&
self
,
F
f
)
{
{
...
...
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