graphtest

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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 added in v0.11.0

func BuildTestBackend() backends.Backend

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

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.

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