Versions in this module Expand all Collapse all v0 v0.2.0 Mar 16, 2026 v0.1.0 Mar 16, 2026 Changes in this version + func AssertContains(t *testing.T, s, substr, msg string) + func AssertEqual[T comparable](t *testing.T, expected, actual T, msg string) + func AssertError(t *testing.T, err error, msg string) + func AssertFalse(t *testing.T, condition bool, msg string) + func AssertFloat32SliceApproxEqual(t *testing.T, expected, actual []float32, tolerance float32, msg string) + func AssertFloat64SliceApproxEqual(t *testing.T, expected, actual []float64, tolerance float64, msg string) + func AssertFloatEqual[T float32 | float64](t *testing.T, expected, actual, tolerance T, msg string) + func AssertNil(t *testing.T, value interface{}, msg string) + func AssertNoError(t *testing.T, err error, msg string) + func AssertNotNil(t *testing.T, value interface{}, msg string) + func AssertPanics(t *testing.T, f func(), msg string) + func AssertTrue(t *testing.T, condition bool, msg string) + func CompareTensorsApprox[T tensor.Addable](t *testing.T, actual, expected *tensor.TensorNumeric[T], epsilon T) bool + func ElementsMatch(a, b []string) bool + func Int64SliceEqual(a, b []int64) bool + func IntSliceEqual(a, b []int) bool + func RunTests(t *testing.T, tests []TestCase) + type FailingInitializer struct + func (f *FailingInitializer[T]) Initialize(_, _ int) ([]T, error) + type MockEngine struct + Err error + func NewMockEngineWithError[T tensor.Numeric](err error) *MockEngine[T] + func NewMockEngine[T tensor.Numeric]() *MockEngine[T] + func (e *MockEngine[T]) Add(_ context.Context, _, _ *tensor.TensorNumeric[T], ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Allocator() device.Allocator + func (e *MockEngine[T]) Close() error + func (e *MockEngine[T]) Context() context.Context + func (e *MockEngine[T]) Copy(_ context.Context, _, _ *tensor.TensorNumeric[T]) error + func (e *MockEngine[T]) Device() device.Device + func (e *MockEngine[T]) Div(_ context.Context, _, _ *tensor.TensorNumeric[T], ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Exp(_ context.Context, _ *tensor.TensorNumeric[T], _ ...*tensor.TensorNumeric[T]) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Log(_ context.Context, _ *tensor.TensorNumeric[T], _ ...*tensor.TensorNumeric[T]) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) MatMul(_ context.Context, _, _ *tensor.TensorNumeric[T], ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Mul(_ context.Context, _, _ *tensor.TensorNumeric[T], ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Name() string + func (e *MockEngine[T]) Pow(_ context.Context, _, _ *tensor.TensorNumeric[T], ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) String() string + func (e *MockEngine[T]) Sub(_ context.Context, _, _ *tensor.TensorNumeric[T], ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Sum(_ context.Context, _ *tensor.TensorNumeric[T], _ int, _ bool, ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Transpose(_ context.Context, _ *tensor.TensorNumeric[T], _ []int, ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) UnaryOp(_ context.Context, _ *tensor.TensorNumeric[T], _ func(T) T, ...) (*tensor.TensorNumeric[T], error) + func (e *MockEngine[T]) Wait() error + func (e *MockEngine[T]) WithAllocator(_ device.Allocator) compute.Engine[T] + func (e *MockEngine[T]) WithContext(_ context.Context) compute.Engine[T] + func (e *MockEngine[T]) WithDevice(_ device.Device) compute.Engine[T] + func (e *MockEngine[T]) WithError(err error) *MockEngine[T] + func (e *MockEngine[T]) WithName(_ string) compute.Engine[T] + func (e *MockEngine[T]) Zero(_ context.Context, _ *tensor.TensorNumeric[T]) error + type TestCase struct + Func func(t *testing.T) + Name string + type TestInitializer struct + Value T + func (t *TestInitializer[T]) Initialize(inputSize, outputSize int) ([]T, error)