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
dbcbaeeb
"vscode:/vscode.git/clone" did not exist on "9526b9ec3c1a1f61cd7bda0b49f175ed5b562834"
Commit
dbcbaeeb
authored
Feb 04, 2019
by
Khalique
Browse files
fix tests, check relu+lrn on gpu
parent
6b1e4b67
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+1
-1
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+6
-6
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+7
-6
No files found.
src/include/migraphx/operators.hpp
View file @
dbcbaeeb
...
@@ -65,7 +65,7 @@ struct lrn
...
@@ -65,7 +65,7 @@ struct lrn
float
alpha
=
0.0001
;
float
alpha
=
0.0001
;
float
beta
=
0.75
;
float
beta
=
0.75
;
float
bias
=
1.0
;
float
bias
=
1.0
;
int
size
;
int
size
=
1
;
std
::
string
name
()
const
{
return
"lrn"
;
}
std
::
string
name
()
const
{
return
"lrn"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
...
...
test/cpu_ops_test.cpp
View file @
dbcbaeeb
...
@@ -733,16 +733,16 @@ TEST_CASE(leaky_relu_test)
...
@@ -733,16 +733,16 @@ TEST_CASE(leaky_relu_test)
TEST_CASE
(
lrn_test
)
TEST_CASE
(
lrn_test
)
{
{
migraph
::
program
p
;
migraph
x
::
program
p
;
migraph
::
shape
s
{
migraph
::
shape
::
float_type
,
{
1
,
5
,
1
,
1
}};
migraph
x
::
shape
s
{
migraph
x
::
shape
::
float_type
,
{
1
,
5
,
1
,
1
}};
auto
l
=
p
.
add_literal
(
migraph
::
literal
{
s
,
{
-
2.0
f
,
1.0
f
,
0.
f
,
1.0
f
,
2.0
f
}});
auto
l
=
p
.
add_literal
(
migraph
x
::
literal
{
s
,
{
-
2.0
f
,
1.0
f
,
0.
f
,
1.0
f
,
2.0
f
}});
p
.
add_instruction
(
migraph
::
op
::
lrn
{
0.0001
,
0.75
,
1
,
5
},
l
);
p
.
add_instruction
(
migraph
x
::
op
::
lrn
{
0.0001
,
0.75
,
1
,
5
},
l
);
p
.
compile
(
migraph
::
cpu
::
target
{});
p
.
compile
(
migraph
x
::
cpu
::
target
{});
auto
result
=
p
.
eval
({});
auto
result
=
p
.
eval
({});
std
::
vector
<
float
>
results_vector
(
5
);
std
::
vector
<
float
>
results_vector
(
5
);
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
std
::
vector
<
float
>
gold
=
{
-
2
/
1.000075
,
1
/
1.00009
,
0
/
1.000145
,
1
/
1.00009
,
2
/
1.000075
};
std
::
vector
<
float
>
gold
=
{
-
2
/
1.000075
,
1
/
1.00009
,
0
/
1.000145
,
1
/
1.00009
,
2
/
1.000075
};
EXPECT
(
migraph
::
verify_range
(
results_vector
,
gold
));
EXPECT
(
migraph
x
::
verify_range
(
results_vector
,
gold
));
}
}
TEST_CASE
(
imagescaler_test
)
TEST_CASE
(
imagescaler_test
)
...
...
test/gpu/miopen.cpp
View file @
dbcbaeeb
...
@@ -637,13 +637,14 @@ struct test_elu
...
@@ -637,13 +637,14 @@ struct test_elu
}
}
};
};
struct
test_lrn
struct
test_
relu_
lrn
{
{
migraph
::
program
create_program
()
const
migraph
x
::
program
create_program
()
const
{
{
migraph
::
program
p
;
migraphx
::
program
p
;
auto
x
=
p
.
add_parameter
(
"x"
,
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
1
,
5
,
2
,
2
}});
auto
x
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
5
,
2
,
2
}});
p
.
add_instruction
(
migraph
::
op
::
lrn
{
0.0001
,
0.75
,
1.0
,
5
},
x
);
auto
y
=
p
.
add_instruction
(
migraphx
::
op
::
relu
{},
x
);
p
.
add_instruction
(
migraphx
::
op
::
lrn
{
0.0001
,
0.75
,
1.0
,
5
},
y
);
return
p
;
return
p
;
}
}
};
};
...
@@ -1097,7 +1098,7 @@ struct test_conv_bn_relu_pooling2
...
@@ -1097,7 +1098,7 @@ struct test_conv_bn_relu_pooling2
int
main
()
int
main
()
{
{
verify_program
<
test_lrn
>
();
verify_program
<
test_
relu_
lrn
>
();
verify_program
<
test_pooling_autopad
>
();
verify_program
<
test_pooling_autopad
>
();
verify_program
<
test_abs
>
();
verify_program
<
test_abs
>
();
verify_program
<
test_concat
>
();
verify_program
<
test_concat
>
();
...
...
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