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
e1818685
Unverified
Commit
e1818685
authored
Feb 23, 2018
by
Matthew Brookhart
Committed by
GitHub
Feb 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overpadded maxpool in INTERPRETER now matches mkldnn behavior (#537)
parent
346607fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
max_pool.hpp
src/ngraph/runtime/kernel/max_pool.hpp
+1
-3
backend_test.in.cpp
test/backend_test.in.cpp
+43
-0
No files found.
src/ngraph/runtime/kernel/max_pool.hpp
View file @
e1818685
...
...
@@ -207,9 +207,7 @@ namespace ngraph
//
// output[O] = max(output[O],arg[I])
T
result
=
std
::
numeric_limits
<
T
>::
has_infinity
?
-
std
::
numeric_limits
<
T
>::
infinity
()
:
std
::
numeric_limits
<
T
>::
min
();
T
result
=
std
::
numeric_limits
<
T
>::
lowest
();
for
(
const
Coordinate
&
input_batch_coord
:
input_batch_transform
)
{
...
...
test/backend_test.in.cpp
View file @
e1818685
...
...
@@ -4596,6 +4596,49 @@ TEST(${BACKEND_NAME}, max_pool_2d_2channel_2image)
read_vector
<
float
>
(
result
));
}
TEST
(
$
{
BACKEND_NAME
},
max_pool_2d_1channel_1image_overpadded
)
{
SKIP_TEST_FOR
(
"GPU"
,
"${BACKEND_NAME}"
);
Shape
shape_a
{
1
,
1
,
5
,
5
};
Shape
window_shape
{
2
,
3
};
auto
window_movement_strides
=
Strides
{
1
,
1
};
Shape
padding_below
{
2
,
0
};
Shape
padding_above
{
1
,
2
};
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
shape_a
);
Shape
shape_r
{
1
,
1
,
6
,
5
};
auto
f
=
make_shared
<
Function
>
(
make_shared
<
op
::
MaxPool
>
(
A
,
window_shape
,
window_movement_strides
,
padding_below
,
padding_above
),
op
::
Parameters
{
A
});
auto
manager
=
runtime
::
Manager
::
get
(
"${BACKEND_NAME}"
);
auto
external
=
manager
->
compile
(
f
);
auto
backend
=
manager
->
allocate_backend
();
auto
cf
=
backend
->
make_call_frame
(
external
);
// Create some tensors for input/output
auto
a
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_a
);
copy_data
(
a
,
test
::
NDArray
<
float
,
4
>
({{{{
0
,
1
,
0
,
2
,
1
},
{
0
,
3
,
2
,
0
,
0
},
{
2
,
0
,
0
,
0
,
1
},
{
2
,
0
,
1
,
1
,
2
},
{
0
,
2
,
1
,
0
,
0
}}}})
.
get_vector
());
auto
result
=
backend
->
make_primary_tensor_view
(
element
::
f32
,
shape_r
);
cf
->
call
({
a
},
{
result
});
auto
min
=
std
::
numeric_limits
<
float
>::
lowest
();
EXPECT_EQ
((
test
::
NDArray
<
float
,
4
>
({{{{
min
,
min
,
min
,
min
,
min
},
{
1
,
2
,
2
,
2
,
1
},
{
3
,
3
,
2
,
2
,
1
},
{
3
,
3
,
2
,
1
,
1
},
{
2
,
1
,
2
,
2
,
2
},
{
2
,
2
,
2
,
2
,
2
}}}})
.
get_vector
()),
read_vector
<
float
>
(
result
));
}
TEST
(
$
{
BACKEND_NAME
},
max_pool_2d_1channel_1image_padded
)
{
SKIP_TEST_FOR
(
"GPU"
,
"${BACKEND_NAME}"
);
...
...
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