forked from owulveryck/onnx-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
35 lines (30 loc) · 797 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package ir
import (
"fmt"
"github.com/pkg/errors"
)
var (
// ErrNotYetImplemented ...
ErrNotYetImplemented = errors.New("Not Yet Implemented")
// ErrNoDataFound ...
ErrNoDataFound = errors.New("No data found")
// ErrCorruptedData ...
ErrCorruptedData = errors.New("Unable to decode data")
)
// ErrNotImplemented is returned for any operator or attribute
type ErrNotImplemented struct {
Operator string
AttributeName string
AttributeValue interface{}
Message string
}
func (e *ErrNotImplemented) Error() string {
if e.AttributeName != "" {
return fmt.Sprintf("onnx: operator %v. Implementation error for attribute %v (%#v): %v",
e.Operator,
e.AttributeName,
e.AttributeValue,
e.Message)
}
return "onnx: operator " + e.Operator + " not implemented"
}