Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
812a699a
Commit
812a699a
authored
Mar 07, 2018
by
Louis Feng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify convbias test.
parent
8b7f042d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
cpu_fusion.cpp
test/cpu_fusion.cpp
+4
-9
No files found.
test/cpu_fusion.cpp
View file @
812a699a
...
...
@@ -619,7 +619,7 @@ struct ConvolutionBiasTestData
shared_ptr
<
op
::
Parameter
>
bias
;
shared_ptr
<
op
::
Parameter
>
delta
;
void
generate_fwd_
n1c1h3w3
(
shared_ptr
<
runtime
::
Backend
>
backend
)
{
void
n1c1h3w3
(
shared_ptr
<
runtime
::
Backend
>
backend
)
{
n
=
1
;
c
=
1
;
filter
=
1
;
...
...
@@ -649,14 +649,8 @@ struct ConvolutionBiasTestData
result_val
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
result_shape
);
copy_data
(
result_val
,
vector
<
float
>
{
0
});
expected_result_val
=
vector
<
float
>
{
-
2.58936238
f
};
}
void
generate_bwd_n1c1h3w3
(
shared_ptr
<
runtime
::
Backend
>
backend
)
{
generate_fwd_n1c1h3w3
(
backend
);
delta
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
result_shape
);
delta_val
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
result_shape
);
copy_data
(
delta_val
,
vector
<
float
>
{
-
2.58936238
f
});
...
...
@@ -673,6 +667,7 @@ struct ConvolutionBiasTestData
d_bias_val
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
bias_shape
);
copy_data
(
d_bias_val
,
vector
<
float
>
{
0
});
expected_result_val
=
vector
<
float
>
{
-
2.58936238
f
};
expected_d_data_val
=
vector
<
float
>
{
-
0.51969099
f
,
1.42333758
f
,
0.5131861
f
,
0.99892044
f
,
-
3.5502491
f
,
0.61600888
f
,
-
0.3849853
f
,
1.29083121
f
,
2.19618773
f
};
...
...
@@ -689,7 +684,7 @@ TEST(cpu_fusion, conv_bias_fprop_n1c1h3w3)
auto
backend
=
manager
->
allocate_backend
();
ConvolutionBiasTestData
conv_test
;
conv_test
.
generate_fwd_
n1c1h3w3
(
backend
);
conv_test
.
n1c1h3w3
(
backend
);
auto
convolution
=
make_shared
<
op
::
Convolution
>
(
conv_test
.
data
,
conv_test
.
weights
);
auto
convolution_bias
=
make_shared
<
op
::
ConvolutionBias
>
(
convolution
,
conv_test
.
bias
);
...
...
@@ -713,7 +708,7 @@ TEST(cpu_fusion, conv_bias_bprop_n1c1h3w3)
auto
backend
=
manager
->
allocate_backend
();
ConvolutionBiasTestData
conv_test
;
conv_test
.
generate_bwd_
n1c1h3w3
(
backend
);
conv_test
.
n1c1h3w3
(
backend
);
auto
convolution
=
make_shared
<
op
::
Convolution
>
(
conv_test
.
data
,
conv_test
.
weights
);
auto
convolution_bias
=
make_shared
<
op
::
ConvolutionBias
>
(
convolution
,
conv_test
.
bias
);
...
...
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