Skip to content

Commit

Permalink
fix: add an explicit error message when the graph has several roots (#50
Browse files Browse the repository at this point in the history
)
  • Loading branch information
owulveryck committed May 9, 2019
1 parent 2f00eed commit b92ff73
Showing 1 changed file with 6 additions and 1 deletion.
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])
}

0 comments on commit b92ff73

Please sign in to comment.