Commit f5b9f783 authored by Khalique's avatar Khalique
Browse files

replace pad with identity when no paddings specified

parent 154f21f6
...@@ -638,6 +638,11 @@ struct onnx_parser ...@@ -638,6 +638,11 @@ struct onnx_parser
auto&& pad_vals = attributes["pads"].ints(); auto&& pad_vals = attributes["pads"].ints();
pads = std::vector<int64_t>(pad_vals.begin(), pad_vals.end()); pads = std::vector<int64_t>(pad_vals.begin(), pad_vals.end());
} }
// check if padding is actually being done (at least one value is nonzero)
if(std::all_of(pads.begin(),pads.end(), [](const int& i){ return i == 0;}))
{
return prog.add_instruction(migraphx::op::identity{}, args.front());
}
if(contains(attributes, "value")) if(contains(attributes, "value"))
{ {
value = parse_value(attributes.at("value")).at<float>(); value = parse_value(attributes.at("value")).at<float>();
......
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