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

Function formatVector

dgraphapi/vector.go:25–28  ·  view source on GitHub ↗
(label string, vector []float32, index int)

Source from the content-addressed store, hash-verified

23}
24
25func formatVector(label string, vector []float32, index int) string {
26 vectorString := fmt.Sprintf(`"[%s]"`, strings.Trim(strings.Join(strings.Fields(fmt.Sprint(vector)), ", "), "[]"))
27 return fmt.Sprintf("<0x%x> <%s> %s . \n", index+10, label, vectorString)
28}
29
30func GenerateRandomVectors(lowerLimit, uppermLimit, vectorSize int, label string) (string, [][]float32) {
31 var builder strings.Builder

Callers 1

GenerateRandomVectorsFunction · 0.70

Calls 1

FieldsMethod · 0.65

Tested by

no test coverage detected