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

Function formatVector

query/vector/vector_test.go:316–319  ·  view source on GitHub ↗
(label string, vector []float32, index int)

Source from the content-addressed store, hash-verified

314}
315
316func formatVector(label string, vector []float32, index int) string {
317 vectorString := fmt.Sprintf(`"[%s]"`, strings.Trim(strings.Join(strings.Fields(fmt.Sprint(vector)), ", "), "[]"))
318 return fmt.Sprintf("<0x%x> <%s> %s . \n", index+10, label, vectorString)
319}
320
321func generateRandomVectors(numVectors, vectorSize int, label string) (string, [][]float32) {
322 var builder strings.Builder

Callers 1

generateRandomVectorsFunction · 0.70

Calls 1

FieldsMethod · 0.65

Tested by

no test coverage detected