Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add an explicit error message when the graph has several roots #50

Merged
merged 1 commit into from May 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion backend/x/gorgonnx/graph.go
@@ -1,6 +1,8 @@
package gorgonnx

import (
"fmt"

"github.com/owulveryck/onnx-go"
"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/simple"
Expand Down Expand Up @@ -57,7 +59,10 @@ func (g *Graph) PopulateExprgraph() error {
}
}
if len(g.roots) != 1 {
return &onnx.ErrNotImplemented{}
return &onnx.ErrNotImplemented{
Message: fmt.Sprintf("the model have %v roots (output), but only graphs with one output is supported by this backend",
len(g.roots)),
}
}
return g.walk(g.roots[0])
}