MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / generateRandomVectors

Function generateRandomVectors

query/vector/vector_test.go:321–333  ·  view source on GitHub ↗
(numVectors, vectorSize int, label string)

Source from the content-addressed store, hash-verified

319}
320
321func generateRandomVectors(numVectors, vectorSize int, label string) (string, [][]float32) {
322 var builder strings.Builder
323 var vectors [][]float32
324 // builder.WriteString("`")
325 for i := 0; i < numVectors; i++ {
326 randomVector := generateRandomVector(vectorSize)
327 vectors = append(vectors, randomVector)
328 formattedVector := formatVector(label, randomVector, i)
329 builder.WriteString(formattedVector)
330 }
331
332 return builder.String(), vectors
333}
334
335func testVectorMutationSameLength(t *testing.T) {
336 rdf, vectors := generateRandomVectors(10, 5, "vtest")

Callers 9

TestVectorReindexFunction · 0.85
TestVectorDeleteFunction · 0.85
TestVectorUpdateFunction · 0.85

Calls 3

generateRandomVectorFunction · 0.85
formatVectorFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected