testing

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package testing includes testing tools shared by the examples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadPythonEmbeddingsList

func ReadPythonEmbeddingsList(path string) ([]float32, error)

ReadPythonEmbeddingsList returns all the embedding values written as text as a large []float32. It's up to the caller to split it according to the expected shape.

It's called "Python" because these embeddings are generated by the test python scripts in internal/py.

func ValidateEmbeddingTensor

func ValidateEmbeddingTensor(t *testing.T, got []float32, expected []float32, name string,
	batchSize, gotSentenceLen, expectedSentenceLen int)

ValidateEmbeddingTensor validates the values of a tensor. It checks the values of the first expectedSentenceLen tokens only, ignoring the padding in case gotSentencenLen > expectedSentenceLen.

Types

This section is empty.

Jump to

Keyboard shortcuts

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