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
231b7edd
Commit
231b7edd
authored
Jun 03, 2018
by
Scott Thornton
Browse files
Added some unary operators
parent
9ace3b74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
20 deletions
+66
-20
src/include/rtg/operators.hpp
src/include/rtg/operators.hpp
+66
-20
No files found.
src/include/rtg/operators.hpp
View file @
231b7edd
...
@@ -246,19 +246,76 @@ struct gemm
...
@@ -246,19 +246,76 @@ struct gemm
}
}
};
};
struct
identity
struct
identity
_op
{
{
std
::
string
name
()
const
{
return
"identity"
;
}
std
::
string
name
()
const
{
return
"identity"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
};
{
check_shapes
{
inputs
}.
has
(
1
);
struct
abs_op
return
inputs
.
at
(
0
);
{
}
std
::
string
name
()
const
{
return
"abs"
;
}
};
struct
exp_op
{
std
::
string
name
()
const
{
return
"exp"
;
}
};
struct
sin_op
{
std
::
string
name
()
const
{
return
"sin"
;
}
};
struct
cos_op
{
std
::
string
name
()
const
{
return
"cos"
;
}
};
struct
tan_op
{
std
::
string
name
()
const
{
return
"tan"
;
}
};
struct
asin_op
{
std
::
string
name
()
const
{
return
"asin"
;
}
};
struct
acos_op
{
std
::
string
name
()
const
{
return
"acos"
;
}
};
struct
atan_op
{
std
::
string
name
()
const
{
return
"atan"
;
}
};
struct
softmax_op
{
std
::
string
name
()
const
{
return
"softmax"
;
}
};
struct
tanh_op
{
std
::
string
name
()
const
{
return
"tanh"
;
}
};
struct
sigmoid_op
{
std
::
string
name
()
const
{
return
"sigmoid"
;
}
};
};
struct
softmax
struct
neg_op
{
{
std
::
string
name
()
const
{
return
"softmax"
;
}
std
::
string
name
()
const
{
return
"neg"
;
}
};
template
<
typename
Op
>
struct
unaryop
{
Op
op
;
std
::
string
name
()
const
{
op
.
name
();
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
check_shapes
{
inputs
}.
has
(
1
);
check_shapes
{
inputs
}.
has
(
1
);
...
@@ -291,17 +348,6 @@ struct div_op
...
@@ -291,17 +348,6 @@ struct div_op
std
::
string
name
()
const
{
return
"div"
;
}
std
::
string
name
()
const
{
return
"div"
;
}
};
};
struct
max_op
{
std
::
string
name
()
const
{
return
"max"
;
}
};
struct
min_op
{
std
::
string
name
()
const
{
return
"min"
;
}
};
// max, min, add, sub
template
<
typename
Op
>
template
<
typename
Op
>
struct
binaryop
struct
binaryop
{
{
...
...
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