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
b6e1065e
Commit
b6e1065e
authored
Mar 23, 2018
by
tsocha
Committed by
adstraw
Mar 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Py] Add UT for avg_pooling_3d (#708)
* [Py] Add UT for avg_pooling_3d(Cover uncontigous data input)
parent
27e0eb96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
test_avg_pooling.py
python/test/ngraph/test_avg_pooling.py
+44
-0
No files found.
python/test/ngraph/test_avg_pooling.py
0 → 100644
View file @
b6e1065e
# ******************************************************************************
# Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
from
__future__
import
print_function
,
division
import
numpy
as
np
import
pytest
import
ngraph
as
ng
def
test_avg_pooling_3d
():
manager_name
=
pytest
.
config
.
getoption
(
'backend'
,
default
=
'CPU'
)
rt
=
ng
.
runtime
(
manager_name
=
manager_name
)
data
=
np
.
arange
(
11
,
27
,
dtype
=
np
.
float32
)
data
=
data
.
reshape
((
1
,
1
,
4
,
4
))
data
=
np
.
broadcast_to
(
data
,
(
1
,
1
,
4
,
4
,
4
))
param
=
ng
.
parameter
(
data
.
shape
)
avgpool
=
ng
.
avg_pool
(
param
,
[
2
,
2
,
2
],
[
2
,
2
,
2
])
comp
=
rt
.
computation
(
avgpool
,
param
)
result
=
comp
(
data
)
result_ref
=
[[[[[
13.5
,
15.5
],
[
21.5
,
23.5
]],
[[
13.5
,
15.5
],
[
21.5
,
23.5
]]]]]
np
.
testing
.
assert_allclose
(
result
,
result_ref
,
rtol
=
0.001
)
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