makeVector returns a float32 slice of length n filled with the given value. Used to produce valid 768-dimensional test vectors.
(n int, val float32)
| 18 | // makeVector returns a float32 slice of length n filled with the given value. |
| 19 | // Used to produce valid 768-dimensional test vectors. |
| 20 | func makeVector(n int, val float32) []float32 { |
| 21 | v := make([]float32, n) |
| 22 | for i := range v { |
| 23 | v[i] = val |
| 24 | } |
| 25 | return v |
| 26 | } |
| 27 | |
| 28 | func TestMemoryHandler(t *testing.T) { |
| 29 | setupHandler := func(t *testing.T) (*handlers.MemoryHandler, *mockErrorResponseWriter) { |