numpy-ts 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -11
- package/dist/esm/common/dtype.js +1 -1
- package/dist/esm/common/internal/compute.js +1 -1
- package/dist/esm/common/internal/indexing.js +1 -1
- package/dist/esm/common/ndarray-core.js +1 -1
- package/dist/esm/common/ops/advanced.js +1 -1
- package/dist/esm/common/ops/arithmetic.js +1 -1
- package/dist/esm/common/ops/bitwise.js +1 -1
- package/dist/esm/common/ops/comparison.js +1 -1
- package/dist/esm/common/ops/complex.js +1 -1
- package/dist/esm/common/ops/exponential.js +1 -1
- package/dist/esm/common/ops/fft.js +1 -1
- package/dist/esm/common/ops/gradient.js +1 -1
- package/dist/esm/common/ops/hyperbolic.js +1 -1
- package/dist/esm/common/ops/linalg.js +2 -2
- package/dist/esm/common/ops/logic.js +1 -1
- package/dist/esm/common/ops/random.js +1 -1
- package/dist/esm/common/ops/reduction.js +1 -1
- package/dist/esm/common/ops/rounding.js +1 -1
- package/dist/esm/common/ops/shape.js +1 -1
- package/dist/esm/common/ops/sorting.js +1 -1
- package/dist/esm/common/ops/statistics.js +1 -1
- package/dist/esm/common/ops/trig.js +1 -1
- package/dist/esm/common/storage.js +1 -1
- package/dist/esm/common/wasm/abs.js +1 -1
- package/dist/esm/common/wasm/add.js +1 -1
- package/dist/esm/common/wasm/all_finite.js +1 -0
- package/dist/esm/common/wasm/arccos.js +1 -1
- package/dist/esm/common/wasm/arcsin.js +1 -1
- package/dist/esm/common/wasm/arctan.js +1 -1
- package/dist/esm/common/wasm/arctan2.js +1 -0
- package/dist/esm/common/wasm/argpartition.js +1 -1
- package/dist/esm/common/wasm/argsort.js +1 -1
- package/dist/esm/common/wasm/bins/abs.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/add.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/all_finite.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/alloc.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/arccos.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/arcsin.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/arctan.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/arctan2.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/argpartition.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/argsort.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_and.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_count.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_not.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_or.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_xor.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cholesky.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/clip.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/convolve.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/copysign.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/correlate.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cos.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cosh.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cross.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/diff.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/divide.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/divmod.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/exp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/exp2.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/fft.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/frexp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/gather.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/gcd.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/gradient.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/heaviside.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/hypot.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/indices.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/inner_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/inner_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/inner_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/isfinite.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/isnan.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/kron.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/ldexp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/left_shift.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/lexsort.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logaddexp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_and.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_not.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_or.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_xor.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/lu.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/max.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/min.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/mul.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/neg.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/outer.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/pad.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/partition.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/power.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/qr.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reciprocal.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_all.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_any.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_argmax.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_argmin.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_count_nz.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_max.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_mean.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_min.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_nanmax.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_nanmin.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_nansum.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_prod.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_std.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_sum.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_var.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/repeat.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/right_shift.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/rng.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/roll.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/searchsorted.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sign.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/signbit.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sin.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sinh.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sort.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sqrt.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/square.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sub.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/svd.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/tan.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/tanh.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/tile.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/unravel_index.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vdot.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/vecdot_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecdot_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecdot_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vector_norm-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vector_norm.wasm.js +1 -0
- package/dist/esm/common/wasm/bitwise_and.js +1 -1
- package/dist/esm/common/wasm/bitwise_count.js +1 -1
- package/dist/esm/common/wasm/bitwise_not.js +1 -1
- package/dist/esm/common/wasm/bitwise_or.js +1 -1
- package/dist/esm/common/wasm/bitwise_xor.js +1 -1
- package/dist/esm/common/wasm/cholesky.js +1 -1
- package/dist/esm/common/wasm/clip.js +1 -1
- package/dist/esm/common/wasm/config.js +1 -1
- package/dist/esm/common/wasm/convolve.js +1 -1
- package/dist/esm/common/wasm/copysign.js +1 -1
- package/dist/esm/common/wasm/correlate.js +1 -1
- package/dist/esm/common/wasm/cos.js +1 -1
- package/dist/esm/common/wasm/cosh.js +1 -1
- package/dist/esm/common/wasm/cross.js +1 -1
- package/dist/esm/common/wasm/detect.js +1 -0
- package/dist/esm/common/wasm/diff.js +1 -1
- package/dist/esm/common/wasm/divide.js +1 -1
- package/dist/esm/common/wasm/divmod.js +1 -0
- package/dist/esm/common/wasm/dot.js +1 -1
- package/dist/esm/common/wasm/exp.js +1 -1
- package/dist/esm/common/wasm/exp2.js +1 -1
- package/dist/esm/common/wasm/fft.js +1 -1
- package/dist/esm/common/wasm/frexp.js +1 -1
- package/dist/esm/common/wasm/gather.js +1 -1
- package/dist/esm/common/wasm/gcd.js +1 -1
- package/dist/esm/common/wasm/gradient.js +1 -1
- package/dist/esm/common/wasm/heaviside.js +1 -1
- package/dist/esm/common/wasm/hypot.js +1 -1
- package/dist/esm/common/wasm/indices.js +1 -1
- package/dist/esm/common/wasm/inner.js +1 -1
- package/dist/esm/common/wasm/isfinite.js +1 -0
- package/dist/esm/common/wasm/isnan.js +1 -0
- package/dist/esm/common/wasm/kron.js +1 -1
- package/dist/esm/common/wasm/ldexp.js +1 -1
- package/dist/esm/common/wasm/left_shift.js +1 -1
- package/dist/esm/common/wasm/lexsort.js +1 -1
- package/dist/esm/common/wasm/logaddexp.js +1 -1
- package/dist/esm/common/wasm/logical_and.js +1 -1
- package/dist/esm/common/wasm/logical_not.js +1 -1
- package/dist/esm/common/wasm/logical_or.js +1 -1
- package/dist/esm/common/wasm/logical_xor.js +1 -1
- package/dist/esm/common/wasm/lu.js +1 -0
- package/dist/esm/common/wasm/matmul.js +1 -1
- package/dist/esm/common/wasm/matvec.js +1 -1
- package/dist/esm/common/wasm/max.js +1 -1
- package/dist/esm/common/wasm/min.js +1 -1
- package/dist/esm/common/wasm/mul.js +1 -1
- package/dist/esm/common/wasm/neg.js +1 -1
- package/dist/esm/common/wasm/outer.js +1 -1
- package/dist/esm/common/wasm/pad.js +1 -1
- package/dist/esm/common/wasm/partition.js +1 -1
- package/dist/esm/common/wasm/power.js +1 -1
- package/dist/esm/common/wasm/qr.js +1 -1
- package/dist/esm/common/wasm/reciprocal.js +1 -1
- package/dist/esm/common/wasm/reduce_all.js +1 -1
- package/dist/esm/common/wasm/reduce_any.js +1 -1
- package/dist/esm/common/wasm/reduce_argmax.js +1 -1
- package/dist/esm/common/wasm/reduce_argmin.js +1 -1
- package/dist/esm/common/wasm/reduce_count_nz.js +1 -1
- package/dist/esm/common/wasm/reduce_max.js +1 -1
- package/dist/esm/common/wasm/reduce_mean.js +1 -1
- package/dist/esm/common/wasm/reduce_min.js +1 -1
- package/dist/esm/common/wasm/reduce_nanmax.js +1 -1
- package/dist/esm/common/wasm/reduce_nanmin.js +1 -1
- package/dist/esm/common/wasm/reduce_nansum.js +1 -1
- package/dist/esm/common/wasm/reduce_prod.js +1 -1
- package/dist/esm/common/wasm/reduce_quantile.js +1 -1
- package/dist/esm/common/wasm/reduce_std.js +1 -1
- package/dist/esm/common/wasm/reduce_sum.js +1 -1
- package/dist/esm/common/wasm/reduce_var.js +1 -1
- package/dist/esm/common/wasm/repeat.js +1 -1
- package/dist/esm/common/wasm/right_shift.js +1 -1
- package/dist/esm/common/wasm/rng.js +1 -1
- package/dist/esm/common/wasm/roll.js +1 -1
- package/dist/esm/common/wasm/runtime.js +1 -1
- package/dist/esm/common/wasm/searchsorted.js +1 -1
- package/dist/esm/common/wasm/sign.js +1 -1
- package/dist/esm/common/wasm/signbit.js +1 -0
- package/dist/esm/common/wasm/sin.js +1 -0
- package/dist/esm/common/wasm/sinh.js +1 -1
- package/dist/esm/common/wasm/sort.js +1 -1
- package/dist/esm/common/wasm/sqrt.js +1 -1
- package/dist/esm/common/wasm/square.js +1 -1
- package/dist/esm/common/wasm/sub.js +1 -1
- package/dist/esm/common/wasm/svd.js +1 -1
- package/dist/esm/common/wasm/tan.js +1 -1
- package/dist/esm/common/wasm/tanh.js +1 -1
- package/dist/esm/common/wasm/tile.js +1 -1
- package/dist/esm/common/wasm/unravel_index.js +1 -0
- package/dist/esm/common/wasm/vdot.js +1 -1
- package/dist/esm/common/wasm/vecdot.js +1 -1
- package/dist/esm/common/wasm/vecmat.js +1 -1
- package/dist/esm/common/wasm/vector_norm.js +1 -0
- package/dist/esm/core/advanced.js +1 -1
- package/dist/esm/core/creation.js +1 -1
- package/dist/esm/core/index.js +1 -1
- package/dist/esm/core/linalg.js +1 -1
- package/dist/esm/core/polynomial.js +1 -1
- package/dist/esm/core/reduction.js +1 -1
- package/dist/esm/core/shape-extra.js +1 -1
- package/dist/esm/core/statistics.js +1 -1
- package/dist/esm/full/index.js +1 -1
- package/dist/esm/full/ndarray.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/io/npy/parser.js +1 -1
- package/dist/esm/io/zip/reader.js +1 -1
- package/dist/numpy-ts.browser.js +6 -6
- package/dist/types/common/dtype.d.ts +46 -0
- package/dist/types/common/internal/indexing.d.ts +9 -0
- package/dist/types/common/ndarray-core.d.ts +20 -0
- package/dist/types/common/ops/advanced.d.ts +17 -2
- package/dist/types/common/ops/complex.d.ts +19 -1
- package/dist/types/common/ops/linalg.d.ts +1 -1
- package/dist/types/common/ops/reduction.d.ts +2 -2
- package/dist/types/common/ops/sets.d.ts +2 -1
- package/dist/types/common/ops/shape.d.ts +2 -2
- package/dist/types/common/ops/statistics.d.ts +2 -1
- package/dist/types/common/storage.d.ts +54 -2
- package/dist/types/common/wasm/all_finite.d.ts +8 -0
- package/dist/types/common/wasm/arccos.d.ts +4 -2
- package/dist/types/common/wasm/arcsin.d.ts +4 -2
- package/dist/types/common/wasm/arctan.d.ts +4 -2
- package/dist/types/common/wasm/arctan2.d.ts +17 -0
- package/dist/types/common/wasm/argpartition.d.ts +8 -3
- package/dist/types/common/wasm/argsort.d.ts +8 -3
- package/dist/types/common/wasm/bins/abs.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/all_finite.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/alloc.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/arccos.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/arcsin.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/arctan.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/arctan2.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/convolve.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/copysign.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/correlate.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/cos.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/cosh.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/divmod.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/dot_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/dot_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/dot_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/exp.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/exp2.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/fft.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/frexp.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/gather.wasm.d.ts +0 -1
- package/dist/types/common/wasm/bins/gcd.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/indices.wasm.d.ts +6 -2
- package/dist/types/common/wasm/bins/inner_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/inner_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/inner_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/isfinite.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/isnan.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/lexsort.wasm.d.ts +4 -4
- package/dist/types/common/wasm/bins/logical_and.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/logical_not.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/logical_or.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/logical_xor.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/lu.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/matmul_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matmul_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matmul_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matvec_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matvec_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matvec_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/neg.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/qr.wasm.d.ts +0 -1
- package/dist/types/common/wasm/bins/reciprocal.wasm.d.ts +8 -4
- package/dist/types/common/wasm/bins/reduce_argmax.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/reduce_argmin.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/reduce_max.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/reduce_min.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/reduce_prod.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/reduce_sum.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/rng.wasm.d.ts +0 -3
- package/dist/types/common/wasm/bins/sign.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/signbit.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/sin.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/sinh.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/sort.wasm.d.ts +4 -4
- package/dist/types/common/wasm/bins/sqrt.wasm.d.ts +2 -2
- package/dist/types/common/wasm/bins/svd.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/tan.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/tanh.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/unravel_index.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/vecdot_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecdot_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecdot_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecmat_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecmat_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecmat_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vector_norm-relaxed.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/vector_norm.wasm.d.ts +3 -0
- package/dist/types/common/wasm/config.d.ts +25 -0
- package/dist/types/common/wasm/convolve.d.ts +1 -1
- package/dist/types/common/wasm/cos.d.ts +4 -2
- package/dist/types/common/wasm/cosh.d.ts +4 -2
- package/dist/types/common/wasm/detect.d.ts +17 -0
- package/dist/types/common/wasm/divide.d.ts +4 -0
- package/dist/types/common/wasm/divmod.d.ts +13 -0
- package/dist/types/common/wasm/exp.d.ts +4 -2
- package/dist/types/common/wasm/exp2.d.ts +4 -2
- package/dist/types/common/wasm/fft.d.ts +5 -5
- package/dist/types/common/wasm/frexp.d.ts +1 -0
- package/dist/types/common/wasm/gather.d.ts +4 -0
- package/dist/types/common/wasm/gcd.d.ts +1 -0
- package/dist/types/common/wasm/hypot.d.ts +4 -2
- package/dist/types/common/wasm/indices.d.ts +2 -1
- package/dist/types/common/wasm/isfinite.d.ts +7 -0
- package/dist/types/common/wasm/isnan.d.ts +7 -0
- package/dist/types/common/wasm/lexsort.d.ts +3 -1
- package/dist/types/common/wasm/logaddexp.d.ts +4 -2
- package/dist/types/common/wasm/lu.d.ts +27 -0
- package/dist/types/common/wasm/partition.d.ts +3 -1
- package/dist/types/common/wasm/reduce_argmax.d.ts +5 -0
- package/dist/types/common/wasm/reduce_argmin.d.ts +5 -0
- package/dist/types/common/wasm/reduce_prod.d.ts +4 -0
- package/dist/types/common/wasm/reduce_quantile.d.ts +11 -3
- package/dist/types/common/wasm/reduce_sum.d.ts +10 -0
- package/dist/types/common/wasm/rng.d.ts +10 -0
- package/dist/types/common/wasm/runtime.d.ts +113 -30
- package/dist/types/common/wasm/searchsorted.d.ts +3 -1
- package/dist/types/common/wasm/signbit.d.ts +14 -0
- package/dist/types/common/wasm/sin.d.ts +17 -0
- package/dist/types/common/wasm/sinh.d.ts +4 -2
- package/dist/types/common/wasm/sort.d.ts +4 -1
- package/dist/types/common/wasm/sqrt.d.ts +4 -2
- package/dist/types/common/wasm/svd.d.ts +6 -0
- package/dist/types/common/wasm/tan.d.ts +4 -2
- package/dist/types/common/wasm/tanh.d.ts +4 -2
- package/dist/types/common/wasm/unravel_index.d.ts +12 -0
- package/dist/types/common/wasm/vector_norm.d.ts +11 -0
- package/dist/types/core/advanced.d.ts +10 -2
- package/dist/types/core/creation.d.ts +1 -1
- package/dist/types/core/index.d.ts +2 -1
- package/dist/types/core/linalg.d.ts +1 -1
- package/dist/types/core/sets.d.ts +4 -1
- package/dist/types/core/statistics.d.ts +2 -1
- package/dist/types/full/index.d.ts +18 -5
- package/dist/types/index.d.ts +3 -1
- package/package.json +36 -43
- package/dist/esm/common/wasm/bins/dot.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/flip.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/inner.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/matmul.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/matvec.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/reduce_quantile.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/rot90.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/vecdot.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/vecmat.wasm.js +0 -1
- package/dist/esm/common/wasm/flip.js +0 -1
- package/dist/esm/common/wasm/rot90.js +0 -1
- package/dist/types/common/wasm/bins/dot.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/flip.wasm.d.ts +0 -7
- package/dist/types/common/wasm/bins/inner.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/matmul.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/matvec.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/reduce_quantile.wasm.d.ts +0 -2
- package/dist/types/common/wasm/bins/rot90.wasm.d.ts +0 -7
- package/dist/types/common/wasm/bins/vecdot.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/vecmat.wasm.d.ts +0 -9
- package/dist/types/common/wasm/flip.d.ts +0 -13
- package/dist/types/common/wasm/rot90.d.ts +0 -14
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Unary: out[i] = cos(a[i])
|
|
5
5
|
* Returns null if WASM can't handle this case.
|
|
6
|
-
* Float types use native kernels; integer types
|
|
7
|
-
*
|
|
6
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
7
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
8
|
+
* i16/u16 → f32
|
|
9
|
+
* i32/u32/i64/u64 → f64
|
|
8
10
|
*/
|
|
9
11
|
import { ArrayStorage } from '../storage';
|
|
10
12
|
/**
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Unary: out[i] = cosh(a[i])
|
|
5
5
|
* Returns null if WASM can't handle this case.
|
|
6
|
-
* Float types use native kernels; integer types
|
|
7
|
-
*
|
|
6
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
7
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
8
|
+
* i16/u16 → f32
|
|
9
|
+
* i32/u32/i64/u64 → f64
|
|
8
10
|
*/
|
|
9
11
|
import { ArrayStorage } from '../storage';
|
|
10
12
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relaxed SIMD feature detection.
|
|
3
|
+
*
|
|
4
|
+
* Probes for relaxed SIMD support using WebAssembly.validate() with a
|
|
5
|
+
* minimal module containing f32x4.relaxed_madd. Sync, cached, zero cost
|
|
6
|
+
* after first call.
|
|
7
|
+
*/
|
|
8
|
+
/** Returns true if the runtime supports WASM relaxed SIMD. Cached after first call. */
|
|
9
|
+
export declare function supportsRelaxedSimd(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Returns true if relaxed SIMD kernels should be used, respecting config override.
|
|
12
|
+
* - 'auto' (default): detect via probe
|
|
13
|
+
* - true: force relaxed (will fail instantiation on unsupported runtimes)
|
|
14
|
+
* - false: force baseline
|
|
15
|
+
*/
|
|
16
|
+
export declare function useRelaxedKernels(): boolean;
|
|
17
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Binary: out[i] = a[i] / b[i]
|
|
5
5
|
* Scalar: out[i] = a[i] / scalar
|
|
6
6
|
* Returns null if WASM can't handle this case.
|
|
7
|
+
* Integer types use type-appropriate output:
|
|
8
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
9
|
+
* i16/u16 → f32
|
|
10
|
+
* i32/u32/i64/u64 → f64
|
|
7
11
|
*/
|
|
8
12
|
import { ArrayStorage } from '../storage';
|
|
9
13
|
export declare function wasmDiv(a: ArrayStorage, b: ArrayStorage): ArrayStorage | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM-accelerated fused divmod (scalar divisor).
|
|
3
|
+
*
|
|
4
|
+
* Computes floor quotient and floor remainder in a single pass.
|
|
5
|
+
* Returns [quotient, remainder] or null if WASM can't handle.
|
|
6
|
+
*/
|
|
7
|
+
import { ArrayStorage } from '../storage';
|
|
8
|
+
/**
|
|
9
|
+
* Fused divmod with scalar divisor.
|
|
10
|
+
* Returns [quotient, remainder] or null if WASM can't handle.
|
|
11
|
+
*/
|
|
12
|
+
export declare function wasmDivmodScalar(a: ArrayStorage, scalar: number): [ArrayStorage, ArrayStorage] | null;
|
|
13
|
+
//# sourceMappingURL=divmod.d.ts.map
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Unary: out[i] = exp(a[i])
|
|
5
5
|
* Returns null if WASM can't handle this case.
|
|
6
|
-
* Float types use native kernels; integer types
|
|
7
|
-
*
|
|
6
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
7
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
8
|
+
* i16/u16 → f32
|
|
9
|
+
* i32/u32/i64/u64 → f64
|
|
8
10
|
*/
|
|
9
11
|
import { ArrayStorage } from '../storage';
|
|
10
12
|
/**
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Unary: out[i] = exp2(a[i])
|
|
5
5
|
* Returns null if WASM can't handle this case.
|
|
6
|
-
* Float types use native kernels; integer types
|
|
7
|
-
*
|
|
6
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
7
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
8
|
+
* i16/u16 → f32
|
|
9
|
+
* i32/u32/i64/u64 → f64
|
|
8
10
|
*/
|
|
9
11
|
import { ArrayStorage } from '../storage';
|
|
10
12
|
/**
|
|
@@ -31,22 +31,22 @@ export declare function wasmIrfft(a: ArrayStorage, nOut: number): ArrayStorage |
|
|
|
31
31
|
* WASM-accelerated 2D complex FFT or IFFT.
|
|
32
32
|
* Input: contiguous complex128 2D array (rows × cols).
|
|
33
33
|
*/
|
|
34
|
-
export declare function wasmFft2(data: Float64Array, rows: number, cols: number, inverse: boolean): Float64Array | null;
|
|
34
|
+
export declare function wasmFft2(data: Float64Array | Float32Array, rows: number, cols: number, inverse: boolean): Float64Array | Float32Array | null;
|
|
35
35
|
/**
|
|
36
36
|
* WASM-accelerated batch 1D complex FFT or IFFT.
|
|
37
37
|
* Processes `batch` contiguous rows of `n` complex elements each.
|
|
38
38
|
*/
|
|
39
|
-
export declare function wasmFftBatch(data: Float64Array, n: number, batch: number, inverse: boolean): Float64Array | null;
|
|
39
|
+
export declare function wasmFftBatch(data: Float64Array | Float32Array, n: number, batch: number, inverse: boolean): Float64Array | Float32Array | null;
|
|
40
40
|
/**
|
|
41
41
|
* WASM-accelerated batch real→complex rfft.
|
|
42
42
|
* Input: real f64 data with `batch` rows of `n` elements.
|
|
43
43
|
*/
|
|
44
|
-
export declare function wasmRfftBatch(srcData: Float64Array, n: number, batch: number, inStride: number, outStride: number): Float64Array | null;
|
|
44
|
+
export declare function wasmRfftBatch(srcData: Float64Array | Float32Array, n: number, batch: number, inStride: number, outStride: number): Float64Array | Float32Array | null;
|
|
45
45
|
/**
|
|
46
46
|
* WASM-accelerated batch complex→real irfft.
|
|
47
47
|
* Input: complex128 data with `batch` rows of `nHalf` complex elements.
|
|
48
48
|
*/
|
|
49
|
-
export declare function wasmIrfftBatch(srcData: Float64Array, nHalf: number, nOut: number, batch: number, inStride: number, outStride: number): Float64Array | null;
|
|
49
|
+
export declare function wasmIrfftBatch(srcData: Float64Array | Float32Array, nHalf: number, nOut: number, batch: number, inStride: number, outStride: number): Float64Array | Float32Array | null;
|
|
50
50
|
/**
|
|
51
51
|
* WASM-accelerated 2D real→complex rfft2.
|
|
52
52
|
* Input: real f64 (rows × cols). Output: complex128 (rows × halfCols).
|
|
@@ -56,7 +56,7 @@ export declare function wasmRfft2(inputData: Float64Array | TypedArray, rows: nu
|
|
|
56
56
|
* WASM-accelerated 2D inverse real FFT (irfft2).
|
|
57
57
|
* Input: complex128 (rows × colsHalf). Output: real f64 (rows × outCols).
|
|
58
58
|
*/
|
|
59
|
-
export declare function wasmIrfft2(inputData: Float64Array, rows: number, colsHalf: number, outCols: number): Float64Array | null;
|
|
59
|
+
export declare function wasmIrfft2(inputData: Float64Array | Float32Array, rows: number, colsHalf: number, outCols: number): Float64Array | Float32Array | null;
|
|
60
60
|
/**
|
|
61
61
|
* WASM-accelerated 3D inverse real FFT (irfftn for 3D).
|
|
62
62
|
* Input: complex128 (d0 × d1 × d2Half). Output: real f64 (d0 × d1 × d2Out).
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WASM-accelerated element-wise frexp (decompose into mantissa + exponent).
|
|
3
3
|
*
|
|
4
4
|
* Returns [mantissa, exponent] where x = mantissa * 2^exponent.
|
|
5
|
+
* Mantissa preserves input dtype (f64→f64, f32→f32, f16→f16).
|
|
5
6
|
* Returns null if WASM can't handle this case.
|
|
6
7
|
*/
|
|
7
8
|
import { ArrayStorage } from '../storage';
|
|
@@ -6,6 +6,10 @@ import { ArrayStorage } from '../storage';
|
|
|
6
6
|
* WASM-accelerated extract (conditional gather).
|
|
7
7
|
* condition must be flattened int32, data must be contiguous.
|
|
8
8
|
* Returns ArrayStorage or null.
|
|
9
|
+
*
|
|
10
|
+
* Note: extract output size is unknown until kernel runs, so we use
|
|
11
|
+
* wasmMalloc for worst-case, then trim. For the actual result we need
|
|
12
|
+
* to know the count, so we read from the persistent region.
|
|
9
13
|
*/
|
|
10
14
|
export declare function wasmExtract(condition: ArrayStorage, storage: ArrayStorage): ArrayStorage | null;
|
|
11
15
|
/**
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* Binary: out[i] = hypot(a[i], b[i]) (same-shape contiguous arrays)
|
|
5
5
|
* Scalar: out[i] = hypot(a[i], scalar)
|
|
6
6
|
* Returns null if WASM can't handle this case.
|
|
7
|
-
* Float types use native kernels;
|
|
8
|
-
*
|
|
7
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
8
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
9
|
+
* i16/u16 → f32
|
|
10
|
+
* i32/u32/i64/u64 → f64
|
|
9
11
|
*/
|
|
10
12
|
import { ArrayStorage } from '../storage';
|
|
11
13
|
/**
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WASM-accelerated np.indices() for 2D and 3D grids.
|
|
3
|
+
* Supports int32, int64, and float64 output dtypes.
|
|
3
4
|
*/
|
|
4
5
|
import { ArrayStorage } from '../storage';
|
|
5
6
|
/**
|
|
6
|
-
* WASM-accelerated indices for 2D/3D grids
|
|
7
|
+
* WASM-accelerated indices for 2D/3D grids.
|
|
7
8
|
* Returns null if WASM can't handle this case.
|
|
8
9
|
*/
|
|
9
10
|
export declare function wasmIndices(dimensions: number[], dtype: string): ArrayStorage | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM-accelerated isfinite: out[i] = 1 if a[i] is finite, else 0.
|
|
3
|
+
* Returns null if WASM can't handle this case.
|
|
4
|
+
*/
|
|
5
|
+
import { ArrayStorage } from '../storage';
|
|
6
|
+
export declare function wasmIsfinite(a: ArrayStorage): ArrayStorage | null;
|
|
7
|
+
//# sourceMappingURL=isfinite.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM-accelerated isnan: out[i] = 1 if a[i] is NaN, else 0.
|
|
3
|
+
* Returns null if WASM can't handle this case.
|
|
4
|
+
*/
|
|
5
|
+
import { ArrayStorage } from '../storage';
|
|
6
|
+
export declare function wasmIsnan(a: ArrayStorage): ArrayStorage | null;
|
|
7
|
+
//# sourceMappingURL=isnan.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WASM-accelerated lexsort (indirect stable sort on multiple keys).
|
|
3
3
|
*
|
|
4
|
+
* Output is float64 indices for JS ergonomics (no BigInt).
|
|
5
|
+
* WASM sorts u32 internally and converts to f64 before returning.
|
|
4
6
|
* All keys must be the same dtype and contiguous.
|
|
5
7
|
* Returns null if WASM can't handle this case.
|
|
6
8
|
*/
|
|
@@ -8,7 +10,7 @@ import { ArrayStorage } from '../storage';
|
|
|
8
10
|
/**
|
|
9
11
|
* WASM-accelerated lexsort.
|
|
10
12
|
* All keys must be the same dtype and 1D contiguous.
|
|
11
|
-
* Returns ArrayStorage of
|
|
13
|
+
* Returns ArrayStorage of float64 indices or null if WASM can't handle it.
|
|
12
14
|
*/
|
|
13
15
|
export declare function wasmLexsort(keys: ArrayStorage[]): ArrayStorage | null;
|
|
14
16
|
//# sourceMappingURL=lexsort.d.ts.map
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* Binary: out[i] = log(exp(a[i]) + exp(b[i])) (same-shape contiguous arrays)
|
|
5
5
|
* Scalar: out[i] = log(exp(a[i]) + exp(scalar))
|
|
6
6
|
* Returns null if WASM can't handle this case.
|
|
7
|
-
* Float types use native kernels;
|
|
8
|
-
*
|
|
7
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
8
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
9
|
+
* i16/u16 → f32
|
|
10
|
+
* i32/u32/i64/u64 → f64
|
|
9
11
|
*/
|
|
10
12
|
import { ArrayStorage } from '../storage';
|
|
11
13
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM-accelerated LU decomposition with partial pivoting.
|
|
3
|
+
*
|
|
4
|
+
* Provides lu_factor, lu_solve, and lu_inv for f64 and f32 square matrices.
|
|
5
|
+
*/
|
|
6
|
+
import { ArrayStorage } from '../storage';
|
|
7
|
+
import type { DType } from '../dtype';
|
|
8
|
+
/**
|
|
9
|
+
* WASM LU factorization. Returns { lu, piv, sign } or null.
|
|
10
|
+
* lu: n×n f64 ArrayStorage with L (below diag) and U (on+above diag).
|
|
11
|
+
* piv: Int32Array of pivot indices.
|
|
12
|
+
* sign: +1 or -1 (permutation sign for determinant).
|
|
13
|
+
*/
|
|
14
|
+
export declare function wasmLuFactor(a: ArrayStorage): {
|
|
15
|
+
lu: ArrayStorage;
|
|
16
|
+
piv: Int32Array;
|
|
17
|
+
sign: number;
|
|
18
|
+
} | null;
|
|
19
|
+
/**
|
|
20
|
+
* WASM LU inverse. Takes pre-computed LU + piv, returns n×n inverse.
|
|
21
|
+
*/
|
|
22
|
+
export declare function wasmLuInv(lu: ArrayStorage, piv: Int32Array, dtype: DType): ArrayStorage | null;
|
|
23
|
+
/**
|
|
24
|
+
* WASM LU solve. Solves LU @ x = b for a single RHS vector.
|
|
25
|
+
*/
|
|
26
|
+
export declare function wasmLuSolve(lu: ArrayStorage, piv: Int32Array, b: ArrayStorage, dtype: DType): ArrayStorage | null;
|
|
27
|
+
//# sourceMappingURL=lu.d.ts.map
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* Returns null if WASM can't handle this case.
|
|
7
7
|
*/
|
|
8
8
|
import { ArrayStorage } from '../storage';
|
|
9
|
-
import type
|
|
9
|
+
import { type DType, TypedArray } from '../dtype';
|
|
10
10
|
/**
|
|
11
11
|
* WASM-accelerated partition of contiguous slices.
|
|
12
12
|
* Uses batch kernel when slices are packed contiguously.
|
|
13
|
+
*
|
|
14
|
+
* Note: operates on pre-existing JS buffers, uses scratch.
|
|
13
15
|
*/
|
|
14
16
|
export declare function wasmPartitionSlices(resultData: TypedArray, sliceOffsets: Int32Array | number[], axisSize: number, outerSize: number, kth: number, dtype: DType): boolean;
|
|
15
17
|
/**
|
|
@@ -11,4 +11,9 @@ import { ArrayStorage } from '../storage';
|
|
|
11
11
|
* Returns null if WASM can't handle (complex types, non-contiguous, too small).
|
|
12
12
|
*/
|
|
13
13
|
export declare function wasmReduceArgmax(a: ArrayStorage): number | null;
|
|
14
|
+
/**
|
|
15
|
+
* WASM-accelerated strided argmax along an axis.
|
|
16
|
+
* Output dtype is always int32 (indices). Returns output ArrayStorage, or null if WASM can't handle.
|
|
17
|
+
*/
|
|
18
|
+
export declare function wasmReduceArgmaxStrided(a: ArrayStorage, outerSize: number, axisSize: number, innerSize: number): ArrayStorage | null;
|
|
14
19
|
//# sourceMappingURL=reduce_argmax.d.ts.map
|
|
@@ -11,4 +11,9 @@ import { ArrayStorage } from '../storage';
|
|
|
11
11
|
* Returns null if WASM can't handle (complex types, non-contiguous, too small).
|
|
12
12
|
*/
|
|
13
13
|
export declare function wasmReduceArgmin(a: ArrayStorage): number | null;
|
|
14
|
+
/**
|
|
15
|
+
* WASM-accelerated strided argmin along an axis.
|
|
16
|
+
* Output dtype is always int32 (indices). Returns output ArrayStorage, or null if WASM can't handle.
|
|
17
|
+
*/
|
|
18
|
+
export declare function wasmReduceArgminStrided(a: ArrayStorage, outerSize: number, axisSize: number, innerSize: number): ArrayStorage | null;
|
|
14
19
|
//# sourceMappingURL=reduce_argmin.d.ts.map
|
|
@@ -17,4 +17,8 @@ export declare function wasmReduceProd(a: ArrayStorage): number | null;
|
|
|
17
17
|
* Returns output ArrayStorage, or null if WASM can't handle.
|
|
18
18
|
*/
|
|
19
19
|
export declare function wasmReduceProdStrided(a: ArrayStorage, outerSize: number, axisSize: number, innerSize: number): ArrayStorage | null;
|
|
20
|
+
/**
|
|
21
|
+
* WASM-accelerated strided product for complex types.
|
|
22
|
+
*/
|
|
23
|
+
export declare function wasmReduceProdStridedComplex(a: ArrayStorage, outerSize: number, axisSize: number, innerSize: number): ArrayStorage | null;
|
|
20
24
|
//# sourceMappingURL=reduce_prod.d.ts.map
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WASM-accelerated quantile computation.
|
|
3
3
|
*
|
|
4
|
-
* Sorts a copy of the data in
|
|
5
|
-
*
|
|
4
|
+
* Sorts a copy of the data in-place using native-dtype sort kernels (same as
|
|
5
|
+
* wasmSort), then interpolates. No f64 conversion — operates on the original
|
|
6
|
+
* dtype for both sort and readback.
|
|
7
|
+
*
|
|
6
8
|
* Returns null if WASM can't handle this case.
|
|
7
9
|
*/
|
|
8
10
|
import { ArrayStorage } from '../storage';
|
|
9
11
|
/**
|
|
10
12
|
* WASM-accelerated quantile (no axis, full array).
|
|
11
|
-
*
|
|
13
|
+
* Sorts a scratch copy in the native dtype, then interpolates.
|
|
12
14
|
* Returns null if WASM can't handle (complex, non-contiguous, too small).
|
|
13
15
|
*/
|
|
14
16
|
export declare function wasmReduceQuantile(a: ArrayStorage, q: number): number | null;
|
|
17
|
+
/**
|
|
18
|
+
* WASM-accelerated strided quantile along an axis.
|
|
19
|
+
* For shape [outer, axisSize, inner], sorts each column and interpolates.
|
|
20
|
+
* Output is [outer * inner] f64, or null if WASM can't handle.
|
|
21
|
+
*/
|
|
22
|
+
export declare function wasmReduceQuantileStrided(storage: ArrayStorage, outer: number, axisSize: number, inner: number, q: number): ArrayStorage | null;
|
|
15
23
|
//# sourceMappingURL=reduce_quantile.d.ts.map
|
|
@@ -11,10 +11,20 @@ import { ArrayStorage } from '../storage';
|
|
|
11
11
|
* Returns null if WASM can't handle (complex types, non-contiguous, too small).
|
|
12
12
|
*/
|
|
13
13
|
export declare function wasmReduceSum(a: ArrayStorage): number | null;
|
|
14
|
+
/**
|
|
15
|
+
* WASM-accelerated global sum for complex types.
|
|
16
|
+
* Returns [re, im] tuple or null.
|
|
17
|
+
*/
|
|
18
|
+
export declare function wasmReduceSumComplex(a: ArrayStorage): [number, number] | null;
|
|
14
19
|
/**
|
|
15
20
|
* WASM-accelerated strided sum along an axis.
|
|
16
21
|
* Output is always f64 (the JS caller converts to the correct output dtype).
|
|
17
22
|
* Returns f64 ArrayStorage, or null if WASM can't handle.
|
|
18
23
|
*/
|
|
19
24
|
export declare function wasmReduceSumStrided(a: ArrayStorage, outerSize: number, axisSize: number, innerSize: number): ArrayStorage | null;
|
|
25
|
+
/**
|
|
26
|
+
* WASM-accelerated strided sum for complex types.
|
|
27
|
+
* Returns ArrayStorage of complex output, or null.
|
|
28
|
+
*/
|
|
29
|
+
export declare function wasmReduceSumStridedComplex(a: ArrayStorage, outerSize: number, axisSize: number, innerSize: number): ArrayStorage | null;
|
|
20
30
|
//# sourceMappingURL=reduce_sum.d.ts.map
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
* Unlike other WASM wrappers, this is always used (no JS fallback).
|
|
5
5
|
* State persists in WASM globals across calls.
|
|
6
6
|
*/
|
|
7
|
+
import { fill_uniform_f64_mt, fill_uniform_f64_pcg, fill_standard_normal_pcg, fill_standard_exponential_pcg, fill_legacy_gauss, fill_legacy_standard_exponential, fill_rk_interval, fill_legacy_standard_gamma, fill_legacy_chisquare, fill_pareto, fill_power, fill_weibull, fill_logistic, fill_gumbel, fill_laplace, fill_rayleigh, fill_triangular, fill_standard_cauchy, fill_lognormal, fill_wald, fill_standard_t, fill_beta, fill_f, fill_noncentral_chisquare, fill_noncentral_f, fill_geometric, fill_poisson, fill_binomial, fill_negative_binomial, fill_hypergeometric, fill_logseries, fill_zipf, fill_vonmises, fill_randint_i64, fill_randint_u8, fill_randint_u16, fill_permutation, fill_permutation_pcg, fill_bounded_uint64_pcg } from './bins/rng.wasm';
|
|
8
|
+
/**
|
|
9
|
+
* Fill directly into a WASM pointer — zero-copy path for callers that already
|
|
10
|
+
* have a persistent WASM allocation (e.g., ArrayStorage.empty()).
|
|
11
|
+
* @param ptr - byte offset into WASM memory to write to
|
|
12
|
+
* @param n - number of elements
|
|
13
|
+
* @param fn - the raw WASM fill kernel
|
|
14
|
+
*/
|
|
15
|
+
export declare function directFill(ptr: number, n: number, fn: (outPtr: number, n: number) => void): void;
|
|
7
16
|
export declare function initMT19937(seed: number): void;
|
|
8
17
|
export declare function mt19937Uint32(): number;
|
|
9
18
|
export declare function mt19937Float64(): number;
|
|
@@ -23,6 +32,7 @@ export declare const legacyGauss: () => number;
|
|
|
23
32
|
export declare const legacyStandardExponential: () => number;
|
|
24
33
|
export declare const legacyGaussReset: () => void;
|
|
25
34
|
export declare const wasmLegacyStandardGamma: (shape: number) => number;
|
|
35
|
+
export { fill_uniform_f64_mt as rawFillUniformF64MT, fill_uniform_f64_pcg as rawFillUniformF64PCG, fill_standard_normal_pcg as rawFillStandardNormalPCG, fill_standard_exponential_pcg as rawFillStandardExponentialPCG, fill_legacy_gauss as rawFillLegacyGauss, fill_legacy_standard_exponential as rawFillLegacyStandardExponential, fill_standard_cauchy as rawFillStandardCauchy, fill_permutation as rawFillPermutation, fill_permutation_pcg as rawFillPermutationPCG, fill_legacy_standard_gamma as rawFillLegacyStandardGamma, fill_legacy_chisquare as rawFillLegacyChisquare, fill_pareto as rawFillPareto, fill_power as rawFillPower, fill_weibull as rawFillWeibull, fill_logistic as rawFillLogistic, fill_gumbel as rawFillGumbel, fill_laplace as rawFillLaplace, fill_rayleigh as rawFillRayleigh, fill_triangular as rawFillTriangular, fill_lognormal as rawFillLognormal, fill_wald as rawFillWald, fill_standard_t as rawFillStandardT, fill_beta as rawFillBeta, fill_f as rawFillF, fill_noncentral_chisquare as rawFillNoncentralChisquare, fill_noncentral_f as rawFillNoncentralF, fill_vonmises as rawFillVonmises, fill_geometric as rawFillGeometric, fill_poisson as rawFillPoisson, fill_binomial as rawFillBinomial, fill_negative_binomial as rawFillNegativeBinomial, fill_hypergeometric as rawFillHypergeometric, fill_logseries as rawFillLogseries, fill_zipf as rawFillZipf, fill_rk_interval as rawFillRkInterval, fill_randint_i64 as rawFillRandintI64, fill_randint_u8 as rawFillRandintU8, fill_randint_u16 as rawFillRandintU16, fill_bounded_uint64_pcg as rawFillBoundedUint64PCG, };
|
|
26
36
|
export declare const fillUniformF64MT: (n: number) => Float64Array<ArrayBuffer>;
|
|
27
37
|
export declare const fillUniformF64PCG: (n: number) => Float64Array<ArrayBuffer>;
|
|
28
38
|
export declare const fillStandardNormalPCG: (n: number) => Float64Array<ArrayBuffer>;
|
|
@@ -1,55 +1,138 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* WASM Runtime —
|
|
2
|
+
* WASM Runtime — zero-copy memory management for all WASM kernels.
|
|
3
3
|
*
|
|
4
|
-
* All
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* All array data lives in a single fixed-size WebAssembly.Memory instance.
|
|
5
|
+
* A persistent free-list allocator (alloc.zig) manages long-lived ArrayStorage
|
|
6
|
+
* data. A scratch bump allocator handles temporary copy-ins for JS-fallback
|
|
7
|
+
* arrays during kernel calls.
|
|
8
|
+
*
|
|
9
|
+
* Memory layout:
|
|
10
|
+
* [WASM statics][--- persistent heap (free-list) ---][--- scratch (bump) ---]
|
|
11
|
+
* 0 heapBase scratchBase maxBytes
|
|
12
|
+
*
|
|
13
|
+
* Because initial === maximum pages, memory.buffer is never detached by grow().
|
|
14
|
+
* All TypedArray views into it remain valid for the program lifetime.
|
|
7
15
|
*/
|
|
8
16
|
import type { TypedArray } from '../dtype';
|
|
17
|
+
import { type ConfigureWasmOptions } from './config';
|
|
9
18
|
/**
|
|
10
19
|
* Get the shared WebAssembly.Memory instance.
|
|
11
|
-
*
|
|
12
|
-
* Starts with 17 pages (~1.1MB) — enough for debug (ReleaseSmall/Safe) WASM builds
|
|
13
|
-
* which have larger binaries and declare higher minimum memory.
|
|
20
|
+
* Allocated once with initial === maximum pages so the buffer never detaches.
|
|
14
21
|
*/
|
|
15
22
|
export declare function getSharedMemory(): WebAssembly.Memory;
|
|
16
23
|
/**
|
|
17
|
-
*
|
|
18
|
-
* (
|
|
24
|
+
* Set the heap base offset. Called by each WASM module on first init
|
|
25
|
+
* (reads __heap_base from exports). The highest value wins.
|
|
19
26
|
*/
|
|
20
|
-
export declare function
|
|
27
|
+
export declare function setHeapBase(base: number): void;
|
|
21
28
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
29
|
+
* Configure WASM memory settings. Must be called before any array operations
|
|
30
|
+
* (i.e. before the WASM memory is initialized on first use).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { configureWasm } from 'numpy-ts';
|
|
35
|
+
* configureWasm({ maxMemory: 512 * 1024 * 1024 }); // 512 MiB
|
|
36
|
+
* ```
|
|
24
37
|
*/
|
|
25
|
-
export declare function
|
|
38
|
+
export declare function configureWasm(options: ConfigureWasmOptions): void;
|
|
39
|
+
export declare class WasmRegion {
|
|
40
|
+
readonly ptr: number;
|
|
41
|
+
readonly byteLength: number;
|
|
42
|
+
private _refCount;
|
|
43
|
+
constructor(ptr: number, byteLength: number);
|
|
44
|
+
retain(): void;
|
|
45
|
+
release(): void;
|
|
46
|
+
get refCount(): number;
|
|
47
|
+
}
|
|
26
48
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
49
|
+
* Register an object (typically ArrayStorage) so that when it is garbage
|
|
50
|
+
* collected, the associated WasmRegion's refcount is decremented.
|
|
51
|
+
* The instance itself is used as the unregister token, allowing
|
|
52
|
+
* eager cleanup via unregisterCleanup() to prevent double-free.
|
|
29
53
|
*/
|
|
30
|
-
export declare function
|
|
54
|
+
export declare function registerForCleanup(instance: object, region: WasmRegion): void;
|
|
55
|
+
/**
|
|
56
|
+
* Unregister an object from the FinalizationRegistry.
|
|
57
|
+
* Must be called when eagerly releasing WASM memory to prevent
|
|
58
|
+
* the GC callback from double-freeing the region.
|
|
59
|
+
*/
|
|
60
|
+
export declare function unregisterCleanup(instance: object): void;
|
|
61
|
+
/**
|
|
62
|
+
* Allocate `bytes` from the persistent WASM heap.
|
|
63
|
+
* Returns a WasmRegion, or null if out of memory (caller should fall back to JS).
|
|
64
|
+
*/
|
|
65
|
+
export declare function wasmMalloc(bytes: number): WasmRegion | null;
|
|
66
|
+
/**
|
|
67
|
+
* Total free bytes in the persistent heap.
|
|
68
|
+
*/
|
|
69
|
+
export declare function wasmFreeBytes(): number;
|
|
70
|
+
/**
|
|
71
|
+
* Reset the scratch bump allocator. Call before each kernel invocation
|
|
72
|
+
* that may need to copy JS-fallback inputs into WASM memory.
|
|
73
|
+
* Also frees any temp heap allocations from the previous kernel call.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resetScratchAllocator(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Bump-allocate `bytes` from the scratch region. Returns byte offset.
|
|
78
|
+
* Always 8-byte aligned. Falls back to heap if scratch space is exhausted.
|
|
79
|
+
*/
|
|
80
|
+
export declare function scratchAlloc(bytes: number): number;
|
|
31
81
|
/**
|
|
32
|
-
*
|
|
33
|
-
* Always 8-byte aligned for TypedArray compatibility.
|
|
82
|
+
* Copy a JS TypedArray into the scratch region. Returns byte offset.
|
|
34
83
|
*/
|
|
35
|
-
export declare function
|
|
84
|
+
export declare function scratchCopyIn(src: TypedArray): number;
|
|
36
85
|
/**
|
|
37
|
-
*
|
|
86
|
+
* Resolve an ArrayStorage input to a WASM pointer for kernel use.
|
|
87
|
+
* If the storage is WASM-backed, returns its direct pointer (zero-copy).
|
|
88
|
+
* If JS-backed, copies data into the scratch region.
|
|
89
|
+
*
|
|
90
|
+
* @param data - The TypedArray from storage.data
|
|
91
|
+
* @param isWasmBacked - Whether the storage is backed by WASM memory
|
|
92
|
+
* @param wasmPtr - The WASM pointer (only valid if isWasmBacked)
|
|
93
|
+
* @param offset - Element offset into the data
|
|
94
|
+
* @param elementCount - Number of elements to resolve
|
|
95
|
+
* @param bpe - Bytes per element
|
|
38
96
|
*/
|
|
39
|
-
export declare function
|
|
97
|
+
export declare function resolveInputPtr(data: TypedArray, isWasmBacked: boolean, wasmPtr: number, offset: number, elementCount: number, bpe: number): number;
|
|
40
98
|
/**
|
|
41
|
-
*
|
|
99
|
+
* Resolve a TypedArray to a WASM pointer. If the array is already a view
|
|
100
|
+
* into WASM memory, returns its byte offset directly (zero-copy).
|
|
101
|
+
* Otherwise copies to scratch. Useful when you have a TypedArray but
|
|
102
|
+
* don't know if it's WASM-backed (e.g. from getContiguousData).
|
|
42
103
|
*/
|
|
43
|
-
export declare function
|
|
104
|
+
export declare function resolveTypedArrayPtr(data: TypedArray): number;
|
|
44
105
|
/**
|
|
45
|
-
* Convert
|
|
46
|
-
*
|
|
47
|
-
*
|
|
106
|
+
* Convert f16 input to f32 in the scratch region using .set() — no JS allocation.
|
|
107
|
+
* Creates Float32Array view on WASM scratch memory and uses .set(f16Data) which
|
|
108
|
+
* converts f16→f32 in-place. 1.2x–3x faster than f16ToF32Input + scratchCopyIn.
|
|
109
|
+
*
|
|
110
|
+
* @param a - The ArrayStorage with f16 data
|
|
111
|
+
* @param size - Number of elements
|
|
112
|
+
* @returns WASM byte offset of the f32 scratch data
|
|
113
|
+
*/
|
|
114
|
+
export declare function f16InputToScratchF32(a: {
|
|
115
|
+
data: TypedArray;
|
|
116
|
+
isWasmBacked: boolean;
|
|
117
|
+
wasmPtr: number;
|
|
118
|
+
offset: number;
|
|
119
|
+
}, size: number): number;
|
|
120
|
+
/**
|
|
121
|
+
* Convert f32 kernel output to f16 in a new WASM region using .set() — no JS round-trip.
|
|
122
|
+
* Allocates a persistent f16 WasmRegion, creates Float16Array + Float32Array views
|
|
123
|
+
* on WASM memory, and uses .set() to convert in-place.
|
|
124
|
+
* Replaces: copyOut + f32ToF16Output + fromData (saves 2 copies).
|
|
125
|
+
*
|
|
126
|
+
* @param outRegion - The WasmRegion containing f32 output from the kernel
|
|
127
|
+
* @param size - Number of elements
|
|
128
|
+
* @returns New WasmRegion with f16 data, or null on OOM. Caller must release outRegion.
|
|
48
129
|
*/
|
|
49
|
-
export declare function
|
|
130
|
+
export declare function f32OutputToF16Region(outRegion: WasmRegion, size: number): WasmRegion | null;
|
|
50
131
|
/**
|
|
51
|
-
* Convert
|
|
52
|
-
*
|
|
132
|
+
* Convert f32 WASM output to f16 in-place within the same region.
|
|
133
|
+
* Safe because f16[i] at byte 2i never reaches unread f32[j>i] at byte 4j.
|
|
134
|
+
* Avoids extra wasmMalloc + release overhead of f32OutputToF16Region.
|
|
135
|
+
* The region retains its original (f32-sized) allocation; the extra bytes are unused.
|
|
53
136
|
*/
|
|
54
|
-
export declare function
|
|
137
|
+
export declare function f32ToF16InPlace(outRegion: WasmRegion, size: number): void;
|
|
55
138
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WASM-accelerated searchsorted (binary search for insertion indices).
|
|
3
3
|
*
|
|
4
|
+
* Output is float64 indices for JS ergonomics (no BigInt).
|
|
5
|
+
* WASM searches u32 internally and converts to f64 before returning.
|
|
4
6
|
* Returns null if WASM can't handle this case.
|
|
5
7
|
*/
|
|
6
8
|
import { ArrayStorage } from '../storage';
|
|
7
9
|
/**
|
|
8
10
|
* WASM-accelerated searchsorted.
|
|
9
|
-
* Returns ArrayStorage of
|
|
11
|
+
* Returns ArrayStorage of float64 insertion indices or null if WASM can't handle it.
|
|
10
12
|
*/
|
|
11
13
|
export declare function wasmSearchsorted(sorted: ArrayStorage, values: ArrayStorage, side: 'left' | 'right'): ArrayStorage | null;
|
|
12
14
|
//# sourceMappingURL=searchsorted.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM-accelerated element-wise signbit with SIMD.
|
|
3
|
+
*
|
|
4
|
+
* Unary: out[i] = 1 if a[i] has negative sign bit, 0 otherwise
|
|
5
|
+
* Returns a boolean (uint8) array.
|
|
6
|
+
* For unsigned types, signbit is always 0 — returns zeros directly.
|
|
7
|
+
*/
|
|
8
|
+
import { ArrayStorage } from '../storage';
|
|
9
|
+
/**
|
|
10
|
+
* WASM-accelerated element-wise signbit.
|
|
11
|
+
* Returns null if WASM can't handle (complex, non-contiguous, too small).
|
|
12
|
+
*/
|
|
13
|
+
export declare function wasmSignbit(a: ArrayStorage): ArrayStorage | null;
|
|
14
|
+
//# sourceMappingURL=signbit.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM-accelerated element-wise sine.
|
|
3
|
+
*
|
|
4
|
+
* Unary: out[i] = sin(a[i])
|
|
5
|
+
* Returns null if WASM can't handle this case.
|
|
6
|
+
* Float types use native kernels; integer types use type-appropriate output:
|
|
7
|
+
* i8/u8 → f32 (then downcast to f16 if available)
|
|
8
|
+
* i16/u16 → f32
|
|
9
|
+
* i32/u32/i64/u64 → f64
|
|
10
|
+
*/
|
|
11
|
+
import { ArrayStorage } from '../storage';
|
|
12
|
+
/**
|
|
13
|
+
* WASM-accelerated element-wise sine.
|
|
14
|
+
* Returns null if WASM can't handle (complex, non-contiguous, too small).
|
|
15
|
+
*/
|
|
16
|
+
export declare function wasmSin(a: ArrayStorage): ArrayStorage | null;
|
|
17
|
+
//# sourceMappingURL=sin.d.ts.map
|