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
d7c4dedf
Commit
d7c4dedf
authored
Feb 05, 2018
by
Jayaram Bobba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style fix
parent
d66b386d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
backend_test.in.cpp
test/backend_test.in.cpp
+22
-14
No files found.
test/backend_test.in.cpp
View file @
d7c4dedf
...
@@ -5619,20 +5619,28 @@ TEST(${BACKEND_NAME}, zero_sized_subtract)
...
@@ -5619,20 +5619,28 @@ TEST(${BACKEND_NAME}, zero_sized_subtract)
make_binary_empty_test
<
op
::
Subtract
>
(
"${BACKEND_NAME}"
);
make_binary_empty_test
<
op
::
Subtract
>
(
"${BACKEND_NAME}"
);
}
}
TEST
(
$
{
BACKEND_NAME
},
convolution_outlining
)
TEST
(
$
{
BACKEND_NAME
},
convolution_outlining
)
{
{
auto
shape_a
=
Shape
{
1
,
2
,
2
,
2
};
auto
shape_a
=
Shape
{
1
,
2
,
2
,
2
};
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
shape_a
);
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
shape_a
);
auto
shape_b
=
Shape
{
2
,
2
,
1
,
1
};
auto
shape_b
=
Shape
{
2
,
2
,
1
,
1
};
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
shape_b
);
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
shape_b
);
auto
shape_r
=
Shape
{
1
,
2
,
2
,
2
};
auto
shape_r
=
Shape
{
1
,
2
,
2
,
2
};
auto
conv1
=
make_shared
<
op
::
Convolution
>
(
A
,
B
,
Strides
{
1
,
1
},
Strides
{
1
,
1
},
auto
conv1
=
make_shared
<
op
::
Convolution
>
(
A
,
CoordinateDiff
{
0
,
0
},
CoordinateDiff
{
0
,
0
},
B
,
Strides
{
1
,
1
});
Strides
{
1
,
1
},
auto
conv2
=
make_shared
<
op
::
Convolution
>
(
conv1
,
B
,
Strides
{
1
,
1
},
Strides
{
1
,
1
},
Strides
{
1
,
1
},
CoordinateDiff
{
0
,
0
},
CoordinateDiff
{
0
,
0
},
CoordinateDiff
{
0
,
0
},
Strides
{
1
,
1
});
CoordinateDiff
{
0
,
0
},
auto
f
=
make_shared
<
Function
>
(
conv2
,
op
::
Parameters
{
A
,
B
});
Strides
{
1
,
1
});
auto
conv2
=
make_shared
<
op
::
Convolution
>
(
conv1
,
B
,
Strides
{
1
,
1
},
Strides
{
1
,
1
},
CoordinateDiff
{
0
,
0
},
CoordinateDiff
{
0
,
0
},
Strides
{
1
,
1
});
auto
f
=
make_shared
<
Function
>
(
conv2
,
op
::
Parameters
{
A
,
B
});
auto
manager
=
runtime
::
Manager
::
get
(
"${BACKEND_NAME}"
);
auto
manager
=
runtime
::
Manager
::
get
(
"${BACKEND_NAME}"
);
auto
external
=
manager
->
compile
(
f
);
auto
external
=
manager
->
compile
(
f
);
...
@@ -5641,12 +5649,12 @@ TEST (${BACKEND_NAME}, convolution_outlining)
...
@@ -5641,12 +5649,12 @@ TEST (${BACKEND_NAME}, convolution_outlining)
// Create some tensors for input/output
// Create some tensors for input/output
auto
a
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_a
);
auto
a
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_a
);
copy_data
(
a
,
vector
<
float
>
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
});
copy_data
(
a
,
vector
<
float
>
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
});
auto
b
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_b
);
auto
b
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_b
);
copy_data
(
b
,
vector
<
float
>
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
});
copy_data
(
b
,
vector
<
float
>
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
});
auto
result
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_r
);
auto
result
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_r
);
vector
<
float
>
expected_result
{
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
};
vector
<
float
>
expected_result
{
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
,
4.0
f
};
cf
->
call
({
a
,
b
},
{
result
});
cf
->
call
({
a
,
b
},
{
result
});
EXPECT_EQ
(
vector
<
float
>
{
expected_result
},
read_vector
<
float
>
(
result
));
EXPECT_EQ
(
vector
<
float
>
{
expected_result
},
read_vector
<
float
>
(
result
));
...
...
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