import "../index-DSGwv2Yx.js";
import { t as e } from "../tensor2d-DTtQ1QcT.js";
function f(n, i) {
  let r = 0;
  const o = i ?? Math.random();
  for (let t = 0; t < n.length; t++)
    if (r += n[t], o < r)
      return e([[t]], [1, 1], "int32");
  return e([[n.length - 1]], [1, 1], "int32");
}
export {
  f as default
};
