MCPcopy Create free account
hub / github.com/OpenAnonymity/oa-chat / randomVector

Function randomVector

experiments/vector-bench.mjs:4–10  ·  view source on GitHub ↗
(dimension)

Source from the content-addressed store, hash-verified

2import { createVectorStore } from '../vector/index.js';
3
4function randomVector(dimension) {
5 const vec = new Float32Array(dimension);
6 for (let i = 0; i < dimension; i += 1) {
7 vec[i] = Math.random();
8 }
9 return vec;
10}
11
12function summarize(label, ms, count) {
13 const per = ms / count;

Callers 1

benchBackendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected