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
79fe7d41
Commit
79fe7d41
authored
Jun 21, 2018
by
Paul
Browse files
Formatting
parent
84f88fcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
src/generate.cpp
src/generate.cpp
+3
-4
src/include/rtg/generate.hpp
src/include/rtg/generate.hpp
+1
-1
No files found.
src/generate.cpp
View file @
79fe7d41
...
...
@@ -5,11 +5,10 @@ namespace rtg {
rtg
::
argument
generate_argument
(
rtg
::
shape
s
,
std
::
mt19937
::
result_type
seed
)
{
rtg
::
argument
result
;
s
.
visit_type
([
&
](
auto
as
)
{
s
.
visit_type
([
&
](
auto
as
)
{
using
type
=
typename
decltype
(
as
)
::
type
;
auto
v
=
generate_tensor_data
<
type
>
(
s
,
seed
);
result
=
{
s
,
[
v
]()
mutable
{
return
reinterpret_cast
<
char
*>
(
v
.
data
());
}};
auto
v
=
generate_tensor_data
<
type
>
(
s
,
seed
);
result
=
{
s
,
[
v
]()
mutable
{
return
reinterpret_cast
<
char
*>
(
v
.
data
());
}};
});
return
result
;
}
...
...
src/include/rtg/generate.hpp
View file @
79fe7d41
...
...
@@ -6,7 +6,7 @@
namespace
rtg
{
template
<
class
T
>
template
<
class
T
>
std
::
vector
<
T
>
generate_tensor_data
(
rtg
::
shape
s
,
std
::
mt19937
::
result_type
seed
=
0
)
{
std
::
vector
<
T
>
result
(
s
.
elements
());
...
...
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