Commit 5ec02d8e authored by tsocha's avatar tsocha Committed by Scott Cyphers

[ONNX] Add support for negative axis attribute in Gather op. (#2902)

parent a006b5c4
......@@ -34,6 +34,10 @@ namespace ngraph
auto data = ng_inputs.at(0);
auto indices = ng_inputs.at(1);
auto axis = node.get_attribute_value<int64_t>("axis", 0);
if (axis < 0)
{
axis += data->get_shape().size();
}
return {std::make_shared<ngraph::op::Gather>(data, indices, axis)};
}
......
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