Commit 2feefb92 authored by Matthew Brookhart's avatar Matthew Brookhart Committed by Scott Cyphers

fix maxpool copy_with_new_args (#541)

* fix maxpool copy_with_new_args

* fix a free(nullptr) error

* update output shape from a maxpool

* remove free gaurd
parent 480cf8f3
......@@ -79,8 +79,11 @@ namespace ngraph
{
throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<MaxPool>(
new_args.at(0), m_window_shape, m_window_movement_strides);
return std::make_shared<MaxPool>(new_args.at(0),
m_window_shape,
m_window_movement_strides,
m_padding_below,
m_padding_above);
}
/// \return The window shape.
......
......@@ -4605,7 +4605,7 @@ TEST(${BACKEND_NAME}, max_pool_2d_1channel_1image_overpadded)
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};
Shape shape_r{1, 1, 7, 5};
auto f = make_shared<Function>(
make_shared<op::MaxPool>(
A, window_shape, window_movement_strides, padding_below, padding_above),
......@@ -4634,7 +4634,8 @@ TEST(${BACKEND_NAME}, max_pool_2d_1channel_1image_overpadded)
{3, 3, 2, 2, 1},
{3, 3, 2, 1, 1},
{2, 1, 2, 2, 2},
{2, 2, 2, 2, 2}}}})
{2, 2, 2, 2, 2},
{2, 2, 1, 0, 0}}}})
.get_vector()),
read_vector<float>(result));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment