Documentation
¶
Overview ¶
Package testbackend provides a set of testing helper functions that test backend interface implementations. The tests are extracted and converted from the onnx test set
Example ¶
package main
import (
"testing"
"github.com/TinyCoderGoose/onnx-go/backend"
"github.com/TinyCoderGoose/onnx-go/backend/testbackend"
)
func main() {
// The backend you want to test
var backend backend.ComputationBackend
// Replace this line in your code by:
// func TestConv(t i*testing.T) {
testConv := func(t *testing.T) {
for _, tc := range testbackend.GetOpTypeTests("Conv") {
tc := tc // capture range variable
t.Run(tc().GetInfo(), tc().RunTest(backend, false))
}
}
_ = testConv
}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAllTestsMatching ¶
FindAllTestsMatching tests matching the regexp
func GetAllRegisteredTests ¶
func GetAllRegisteredTests() []func() *TestCase
GetAllRegisteredTests ...
func GetOpTypeTests ¶
GetOpTypeTests returns all the tests of the OpType passed as argument
Types ¶
type TestCase ¶
type TestCase struct {
OpType string
Title string
ModelB []byte
Input []tensor.Tensor
ExpectedOutput []tensor.Tensor
Tested bool // true if the test has be executed
Skipped bool // true if the test has been executed and skipped
Failed bool // true if the test failed
}
TestCase describes an integration test
func (*TestCase) Dump ¶
Dump a raw version of the onnx data decoded in the protobuf structure. Useful for debugging
Click to show internal directories.
Click to hide internal directories.