Commit 5d74b489 authored by Fabian Boemer's avatar Fabian Boemer Committed by Scott Cyphers

Serializer supports new pad api (#2739)

* Serializer supports new pad api

* Addressed reviewer comment

* Fixed compiler warning
parent 483b99e9
......@@ -981,11 +981,15 @@ static shared_ptr<ngraph::Function>
// This is a legacy field whose functionality is no longer supported. The new
// behavior is equivalent to interior padding of 0, so we will accept it under
// those conditions.
auto padding_interior = node_js.at("padding_interior").get<vector<size_t>>();
auto padding_interior_maybe = node_js.find("padding_interior");
if (padding_interior_maybe != node_js.end())
{
auto padding_interior = padding_interior_maybe->get<vector<size_t>>();
NGRAPH_ASSERT(std::all_of(padding_interior.begin(),
padding_interior.end(),
[](size_t s) { return s == 0; }))
<< "Legacy padding_interior field must be zero everywhere.";
}
auto pad_mode = node_js.count("pad_mode") == 0
? op::PadMode::CONSTANT
......
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