testgrad

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package testgrad provides function to test autograd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func struct {
	// GradOf declares the function (which must be named `F`) to compute the gradient of.
	GradOf string

	// Want stores the source code of the expected gradient of the function
	Want string

	// GradImportName is the name of the import of the grad package.
	// If empty, then the default import name is used.
	GradImportName string

	// Err is the substring expected if the compiler returns an error.
	Err string
}

Func tests the computation of the gradient of a function.

func (Func) Run

func (tt Func) Run(b *testbuild.Builder) error

Run builds the declarations as a package, then compare to an expected outcome.

func (Func) Source

func (tt Func) Source() string

Source code of the declarations.

Jump to

Keyboard shortcuts

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