MCPcopy Create free account
hub / github.com/evilsocket/sum / BenchmarkWrappedRecordDot

Function BenchmarkWrappedRecordDot

wrapper/record_benchmark_test.go:51–63  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

49}
50
51func BenchmarkWrappedRecordDot(b *testing.B) {
52 testRecord.Data = []float32{3, 6, 9}
53 shouldBe := 126.0
54
55 a := WrapRecord(&testRecord)
56 c := WrapRecord(&testRecord)
57
58 for i := 0; i < b.N; i++ {
59 if dot := a.Dot(c); dot != shouldBe {
60 b.Fatalf("dot product should be %f, got %f", shouldBe, dot)
61 }
62 }
63}
64
65func wrappedRecordDotN(b *testing.B, N int) {
66 a := pb.Record{Data: make([]float32, N)}

Callers

nothing calls this directly

Calls 2

WrapRecordFunction · 0.85
DotMethod · 0.65

Tested by

no test coverage detected