Commit 47212d64 authored by Paul's avatar Paul
Browse files

Fix unknown test

parent 3d02e1dc
......@@ -685,8 +685,7 @@ struct onnx_parser
}
for(auto&& p : nodes)
{
for(auto&& output : p.second.output())
this->parse_node(output);
this->parse_node(p.first);
}
}
......@@ -720,6 +719,13 @@ struct onnx_parser
{
result = ops[node.op_type()](get_attributes(node), args);
}
// Even no output nodes produce output in migraphx
if (node.output().empty() and result.size() == 1)
{
instructions[name] = result.front();
}
else
{
assert(node.output().size() >= result.size());
std::transform(result.begin(),
result.end(),
......@@ -728,6 +734,7 @@ struct onnx_parser
[](auto&& x, auto&& y) { return std::make_pair(y, x); });
}
}
}
static attribute_map get_attributes(const onnx::NodeProto& node)
{
......@@ -755,8 +762,21 @@ struct onnx_parser
static node_map get_nodes(const onnx::GraphProto& graph)
{
std::unordered_map<std::string, onnx::NodeProto> result;
std::size_t n = 0;
for(auto&& node : graph.node())
{
if (node.output().empty())
{
if (node.name().empty())
{
result["migraphx_unamed_node_" + std::to_string(n)] = node;
n++;
}
else
{
result[node.name()] = node;
}
}
for(auto&& output : node.output())
{
result[output] = node;
......
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