graphtest

package
v0.28.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package graphtest holds test utilities for packages that depend on the graph package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTestBackend deprecated

func BuildTestBackend() compute.Backend

BuildTestBackend and sets compute.DefaultConfig to "xla:cpu" -- it can be overwritten by GOMLX_BACKEND environment variable.

Deprecated: use testutil.BuildTestBackend instead.

func RunTestGraphFn

func RunTestGraphFn(t *testing.T, testName string, graphFn TestGraphFn, want []any, delta float64)

RunTestGraphFn tests a graph building function graphFn by executing it and comparing its output(s) to the values in want, reporting back any errors in t.

delta is the margin of value on the difference of output and want values that are acceptable. Values of delta <= 0 means only exact equality is accepted.

func RunTestGraphFnWithBackend

func RunTestGraphFnWithBackend(t *testing.T, testName string, backend compute.Backend, graphFn TestGraphFn, want []any, delta float64)

RunTestGraphFnWithBackend tests a graph building function graphFn by executing it and comparing its output(s) to the values in want, reporting back any errors in t.

delta is the margin of value on the difference of output and want values that are acceptable. Values of delta <= 0 means only exact equality is accepted.

func TestOfficialBackends deprecated

func TestOfficialBackends(t *testing.T, testFn func(t *testing.T, backend compute.Backend), excludeBackends ...string)

TestOfficialBackends iterates over list of backends and calls testFn for each of them. If GOMLX_BACKEND environment variable is set, it will only iterate over the one set. If GOMLX_BACKEND is not set, it will iterate over all official backends, except those in excludecompute. (for tests known not to work on those backends)

Deprecated: use testutil.TestOfficialBackends instead.

Types

type TestGraphFn

type TestGraphFn func(g *graph.Graph) (inputs, outputs []*graph.Node)

TestGraphFn should build its own inputs, and return both inputs and outputs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL