@jax-js/jax 0.1.4 → 0.1.5

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/dist/index.d.cts CHANGED
@@ -440,10 +440,37 @@ declare enum Routines {
440
440
  Sort = "Sort",
441
441
  /** Returns `int32` indices of the stably sorted array. */
442
442
  Argsort = "Argsort",
443
- /** Solve a triangular system of questions. */
443
+ /**
444
+ * Solve a triangular system of equations.
445
+ *
446
+ * The first batch of inputs `A` should be of shape `[..., N, N]` and upper
447
+ * triangular, while the second batch `B` should be of shape `[..., M, N]`.
448
+ *
449
+ * Solves for `X` in the equation `A @ X.T = B.T`, where `A` is the
450
+ * triangular matrix. This is equivalent to `X = B @ A^-T`.
451
+ */
444
452
  TriangularSolve = "TriangularSolve",
445
- /** Cholesky decomposition of 2D positive semi-definite matrices. */
453
+ /**
454
+ * Cholesky decomposition of 2D positive semi-definite matrices.
455
+ *
456
+ * The input batch should be of shape `[..., N, N]`, and the output batch is
457
+ * of the same shape, containing the lower-triangular matrix `L` such that
458
+ * `A = L @ L.T`. Behavior is unspecified if A is not positive semi-definite.
459
+ */
446
460
  Cholesky = "Cholesky",
461
+ /**
462
+ * LU decomposition of 2D rectangular matrices.
463
+ *
464
+ * The input is a batch of shape `[..., M, N]`, and the output is a tuple of
465
+ * three arrays: `LU, Pivots, Permutation`.
466
+ *
467
+ * - `LU` is of shape `[..., M, N]`, containing the combined lower and upper
468
+ * triangular matrices. (lower triangular = implicit unit diagonal)
469
+ * - `Pivots` is of shape `[..., min(M, N)]`, containing the row swaps.
470
+ * - `Permutation` is of shape `[..., M]`, containing the permutation vector
471
+ * such that `P = eye(M).slice(Permutation)` -> `P @ A = L @ U`.
472
+ */
473
+ LU = "LU",
447
474
  }
448
475
  interface RoutineType {
449
476
  inputShapes: number[][];
@@ -453,7 +480,7 @@ interface RoutineType {
453
480
  }
454
481
  //#endregion
455
482
  //#region src/backend.d.ts
456
- type Device = "cpu" | "wasm" | "webgpu";
483
+ type Device = "cpu" | "wasm" | "webgpu" | "webgl";
457
484
  declare const devices: Device[];
458
485
  /** Configure the default device for arrays. */
459
486
  declare function defaultDevice(device?: Device): Device;
@@ -538,7 +565,7 @@ declare function fft(a: ComplexPair, axis?: number): ComplexPair;
538
565
  */
539
566
  declare function ifft(a: ComplexPair, axis?: number): ComplexPair;
540
567
  declare namespace numpy_linalg_d_exports {
541
- export { cholesky$1 as cholesky, diagonal, lstsq, matmul, matrixTranspose, outer, tensordot, trace, vecdot };
568
+ export { cholesky$1 as cholesky, det, diagonal, inv, lstsq, matmul, matrixPower, matrixTranspose, outer, slogdet, solve, tensordot, trace, vecdot };
542
569
  }
543
570
  /**
544
571
  * Compute the Cholesky decomposition of a (batched) positive-definite matrix.
@@ -553,6 +580,10 @@ declare function cholesky$1(a: ArrayLike, {
553
580
  upper?: boolean;
554
581
  symmetrizeInput?: boolean;
555
582
  }): Array;
583
+ /** Compute the determinant of a square matrix (batched). */
584
+ declare function det(a: ArrayLike): Array;
585
+ /** Compute the inverse of a square matrix (batched). */
586
+ declare function inv(a: ArrayLike): Array;
556
587
  /**
557
588
  * Return the least-squares solution to a linear equation.
558
589
  *
@@ -567,8 +598,75 @@ declare function cholesky$1(a: ArrayLike, {
567
598
  * @return least-squares solution of shape `(N,)` or `(N, K)`
568
599
  */
569
600
  declare function lstsq(a: ArrayLike, b: ArrayLike): Array;
601
+ /** Raise a square matrix to an integer power, via repeated squarings. */
602
+ declare function matrixPower(a: ArrayLike, n: number): Array;
603
+ /** Return sign and natural logarithm of the determinant of `a`. */
604
+ declare function slogdet(a: ArrayLike): [Array, Array];
605
+ /**
606
+ * Solve a linear system of equations.
607
+ *
608
+ * This solves a (batched) linear system of equations `a @ x = b` for `x` given
609
+ * `a` and `b`. If `a` is singular, this will return `nan` or `inf` values.
610
+ *
611
+ * @param a - Coefficient matrix of shape `(..., N, N)`.
612
+ * @param b - Values of shape `(N,)` or `(..., N, M)`.
613
+ * @returns Solution `x` of shape `(..., N)` or `(..., N, M)`.
614
+ */
615
+ declare function solve(a: ArrayLike, b: ArrayLike): Array;
616
+ //#endregion
617
+ //#region src/library/numpy/dtype-info.d.ts
618
+ /** @inline */
619
+ type FInfo = Readonly<{
620
+ /** The number of bits occupied by the type. */
621
+ bits: number;
622
+ /** Returns the _dtype_ for which finfo returns information. */
623
+ dtype: DType;
624
+ /** The difference between 1.0 and the next smallest representable float larger than 1.0. */
625
+ eps: number;
626
+ /** The difference between 1.0 and the next largest representable float smaller than 1.0. */
627
+ epsneg: number;
628
+ /** The exponent that yields `eps`. */
629
+ machep: number;
630
+ /** The largest representable finite number. */
631
+ max: number;
632
+ /** The smallest positive power of the base (2) that causes overflow. */
633
+ maxexp: number;
634
+ /** The smallest representable (most negative) finite number. */
635
+ min: number;
636
+ /** The largest negative power of the base (2) without leading zeros in mantissa. */
637
+ minexp: number;
638
+ /** The exponent that yields `epsneg`. */
639
+ negep: number;
640
+ /** Number of bits in the exponent portion. */
641
+ nexp: number;
642
+ /** Number of bits in the mantissa portion. */
643
+ nmant: number;
644
+ /** The approximate number of decimal digits to which this kind of float is precise. */
645
+ precision: number;
646
+ /** The approximate decimal resolution, i.e., `10 ** -precision`. */
647
+ resolution: number;
648
+ /** The smallest positive normal number. */
649
+ smallestNormal: number;
650
+ /** The smallest positive subnormal number. */
651
+ smallestSubnormal: number;
652
+ }>;
653
+ /** Machine limits for floating-point types. */
654
+ declare function finfo(dtype: DType): FInfo;
655
+ /** @inline */
656
+ type IInfo = Readonly<{
657
+ /** The number of bits occupied by the type. */
658
+ bits: number;
659
+ /** Returns the _dtype_ for which iinfo returns information. */
660
+ dtype: DType;
661
+ /** The largest representable integer. */
662
+ max: number;
663
+ /** The smallest representable integer. */
664
+ min: number;
665
+ }>;
666
+ /** Machine limits for integer types. */
667
+ declare function iinfo(dtype: DType): IInfo;
570
668
  declare namespace numpy_d_exports {
571
- export { Array, ArrayLike, DType, absolute as abs, absolute, acos, arccosh as acosh, add, all, allclose, any, arange, acos as arccos, arccosh, asin as arcsin, arcsinh, atan as arctan, atan2 as arctan2, arctanh, argmax, argmin, argsort, array, asin, arcsinh as asinh, astype, atan, atan2, arctanh as atanh, bool, broadcastArrays, broadcastShapes, broadcastTo, cbrt, ceil, clip, columnStack, concatenate, convolve, corrcoef, correlate, cos, cosh, cov, cumsum, cumsum as cumulativeSum, deg2rad, degrees, diag, diagonal, trueDivide as divide, dot$1 as dot, dstack, e, einsum, equal, eulerGamma, exp, exp2, expandDims, expm1, eye, numpy_fft_d_exports as fft, flip, fliplr, flipud, float16, float32, float64, floor, fmod, frexp, full, fullLike, greater, greaterEqual, hamming, hann, heaviside, hstack, hypot, identity$1 as identity, inf, inner, int32, isfinite, isinf, isnan, isneginf, isposinf, ldexp, less, lessEqual, numpy_linalg_d_exports as linalg, linspace, log, log10, log1p, log2, matmul, matrixTranspose, max, maximum, mean, meshgrid, min, minimum, moveaxis, multiply, nan, ndim, negative, notEqual, ones, onesLike, outer, pad, transpose as permuteDims, pi, positive, power as pow, power, prod, promoteTypes, ptp, rad2deg, radians, ravel, reciprocal, remainder, repeat, reshape, shape$1 as shape, sign, sin, sinh, size, sort, sqrt, square, squeeze, stack, std, subtract, sum, tan, tanh, tensordot, tile, trace, transpose, tri, tril, triu, trueDivide, trunc, uint32, var_, vdot, vecdot, vstack, where, zeros, zerosLike };
669
+ export { Array, ArrayLike, DType, absolute as abs, absolute, acos, arccosh as acosh, add, all, allclose, any, arange, acos as arccos, arccosh, asin as arcsin, arcsinh, atan as arctan, atan2 as arctan2, arctanh, argmax, argmin, argsort, array, asin, arcsinh as asinh, astype, atan, atan2, arctanh as atanh, bool, broadcastArrays, broadcastShapes, broadcastTo, cbrt, ceil, clip, columnStack, concatenate, convolve, corrcoef, correlate, cos, cosh, cov, cumsum, cumsum as cumulativeSum, deg2rad, degrees, diag, diagonal, trueDivide as divide, divmod, dot$1 as dot, dstack, e, einsum, equal, eulerGamma, exp, exp2, expandDims, expm1, eye, numpy_fft_d_exports as fft, finfo, flip, fliplr, flipud, float16, float32, float64, floor, floorDivide, fmod, frexp, full, fullLike, greater, greaterEqual, hamming, hann, heaviside, hstack, hypot, identity$1 as identity, iinfo, inf, inner, int32, isfinite, isinf, isnan, isneginf, isposinf, ldexp, less, lessEqual, numpy_linalg_d_exports as linalg, linspace, log, log10, log1p, log2, logspace, matmul, matrixTranspose, max, maximum, mean, meshgrid, min, minimum, moveaxis, multiply, nan, ndim, negative, notEqual, ones, onesLike, outer, pad, transpose as permuteDims, pi, positive, power as pow, power, prod, promoteTypes, ptp, rad2deg, radians, ravel, reciprocal, remainder, repeat, reshape, shape$1 as shape, sign, sin, sinc, sinh, size, sort, split$1 as split, sqrt, square, squeeze, stack, std, subtract, sum, take, tan, tanh, tensordot, tile, trace, transpose, tri, tril, triu, trueDivide, trunc, uint32, var_, vdot, vecdot, vstack, where, zeros, zerosLike };
572
670
  }
573
671
  declare const float32 = DType.Float32;
574
672
  declare const int32 = DType.Int32;
@@ -735,6 +833,16 @@ declare function argmax(a: ArrayLike, axis?: number, opts?: ReduceOpts): Array;
735
833
  declare function cumsum(a: ArrayLike, axis?: number): Array;
736
834
  /** Reverse the elements in an array along the given axes. */
737
835
  declare function flip(x: ArrayLike, axis?: Axis): Array;
836
+ /**
837
+ * Split an array into multiple sub-arrays along an axis.
838
+ *
839
+ * @param a - The input array to split.
840
+ * @param indicesOrSections - If an integer, it indicates the number of equal
841
+ * sections to create along the specified axis. If a list of integers, it
842
+ * specifies the indices at which to split the array.
843
+ * @param axis - The axis along which to split the array. Default is 0.
844
+ */
845
+ declare function split$1(a: ArrayLike, indicesOrSections: number | number[], axis?: number): Array[];
738
846
  /**
739
847
  * Join a sequence of arrays along an existing axis.
740
848
  *
@@ -863,6 +971,13 @@ declare function sort(a: ArrayLike, axis?: number): Array;
863
971
  * The array is sorted along a specified axis (the last by default).
864
972
  */
865
973
  declare function argsort(a: ArrayLike, axis?: number): Array;
974
+ /**
975
+ * Take elements from an array along an axis.
976
+ *
977
+ * This is equivalent to advanced indexing with integer indices over that
978
+ * numbered axis. By default, the flattened array is used.
979
+ */
980
+ declare function take(a: ArrayLike, indices: ArrayLike, axis?: number | null): Array;
866
981
  /** Return if two arrays are element-wise equal within a tolerance. */
867
982
  declare function allclose(actual: Parameters<typeof array>[0], expected: Parameters<typeof array>[0], options?: {
868
983
  rtol?: number;
@@ -993,6 +1108,17 @@ declare const heaviside: OwnedFunction<(x1: ArrayLike, x2: ArrayLike) => Array>;
993
1108
  declare function square(x: ArrayLike): Array;
994
1109
  /** Element-wise tangent function (takes radians). */
995
1110
  declare function tan(x: ArrayLike): Array;
1111
+ /**
1112
+ * @function
1113
+ * Return the normalized sinc function.
1114
+ *
1115
+ * The sinc function is defined as `sin(πx) / (πx)` for `x != 0`, and `1` for `x = 0`.
1116
+ * This is the normalized sinc function commonly used in signal processing.
1117
+ *
1118
+ * **Note:** JVP is not supported at x=0 due to discontinuous derivative. This
1119
+ * requires a custom JVP rule to handle properly (see JAX implementation).
1120
+ */
1121
+ declare const sinc: OwnedFunction<(x: ArrayLike) => Array>;
996
1122
  /** Element-wise inverse cosine function (inverse of cos). */
997
1123
  declare function acos(x: ArrayLike): Array;
998
1124
  /**
@@ -1022,6 +1148,20 @@ declare const atan2: OwnedFunction<(y: ArrayLike, x: ArrayLike) => Array>;
1022
1148
  declare function subtract(x: ArrayLike, y: ArrayLike): Array;
1023
1149
  /** Calculates the floating-point division of x by y element-wise. */
1024
1150
  declare function trueDivide(x: ArrayLike, y: ArrayLike): Array;
1151
+ /**
1152
+ * Return the largest integer smaller or equal to the division of the inputs.
1153
+ *
1154
+ * The result is always rounded towards negative infinity.
1155
+ *
1156
+ * For floating-point inputs, this is equivalent to `floor(x / y)`.
1157
+ * For integer inputs, we use `(x - remainder(x, y)) / y` to handle
1158
+ * negative values correctly (note: may overflow near int32 boundaries).
1159
+ *
1160
+ * @param x - Dividend array.
1161
+ * @param y - Divisor array.
1162
+ * @returns Element-wise floor division of x by y.
1163
+ */
1164
+ declare function floorDivide(x: ArrayLike, y: ArrayLike): Array;
1025
1165
  /**
1026
1166
  * @function
1027
1167
  * Calculate element-wise floating-point modulo operation.
@@ -1032,6 +1172,16 @@ declare const fmod: OwnedFunction<(x: ArrayLike, y: ArrayLike) => Array>;
1032
1172
  * Calculate element-wise remainder of the division (matches sign of y).
1033
1173
  */
1034
1174
  declare const remainder: OwnedFunction<(x: ArrayLike, y: ArrayLike) => Array>;
1175
+ /**
1176
+ * Return element-wise quotient and remainder simultaneously.
1177
+ *
1178
+ * Equivalent to `[floorDivide(x, y), remainder(x, y)]`.
1179
+ *
1180
+ * @param x - Dividend array.
1181
+ * @param y - Divisor array.
1182
+ * @returns Tuple of [quotient, remainder].
1183
+ */
1184
+ declare function divmod(x: ArrayLike, y: ArrayLike): [Array, Array];
1035
1185
  /** Round input to the nearest integer towards zero. */
1036
1186
  declare function trunc(x: ArrayLike): Array;
1037
1187
  /**
@@ -1142,7 +1292,11 @@ declare function std(x: ArrayLike, axis?: Axis, opts?: {
1142
1292
  correction?: number;
1143
1293
  } & ReduceOpts): Array;
1144
1294
  /** Estimate the sample covariance of a set of variables. */
1145
- declare function cov(x: ArrayLike, y?: ArrayLike): Array;
1295
+ declare function cov(x: ArrayLike, y?: ArrayLike | null, {
1296
+ rowvar
1297
+ }?: {
1298
+ rowvar?: boolean;
1299
+ }): Array;
1146
1300
  /** Compute the Pearson correlation coefficients (in range `[-1, 1]`). */
1147
1301
  declare function corrcoef(x: ArrayLike, y?: ArrayLike): Array;
1148
1302
  /** Test element-wise for positive or negative infinity, return bool array. */
@@ -1356,6 +1510,8 @@ declare enum Primitive {
1356
1510
  PoolTranspose = "pool_transpose",
1357
1511
  Compare = "compare",
1358
1512
  Where = "where",
1513
+ Concatenate = "concatenate",
1514
+ Split = "split",
1359
1515
  RandomBits = "random_bits",
1360
1516
  Gather = "gather",
1361
1517
  Transpose = "transpose",
@@ -1372,6 +1528,8 @@ declare enum Primitive {
1372
1528
  // A is upper triangular, A @ X.T = B.T
1373
1529
  Cholesky = "cholesky",
1374
1530
  // A is positive-definite, A = L @ L^T
1531
+ LU = "lu",
1532
+ // LU decomposition with partial pivoting
1375
1533
  Jit = "jit",
1376
1534
  }
1377
1535
  interface PrimitiveParamsImpl extends Record<Primitive, Record<string, any>> {
@@ -1398,6 +1556,13 @@ interface PrimitiveParamsImpl extends Record<Primitive, Record<string, any>> {
1398
1556
  [Primitive.Compare]: {
1399
1557
  op: CompareOp;
1400
1558
  };
1559
+ [Primitive.Concatenate]: {
1560
+ axis: number;
1561
+ };
1562
+ [Primitive.Split]: {
1563
+ axis: number;
1564
+ sizes: number[];
1565
+ };
1401
1566
  [Primitive.RandomBits]: {
1402
1567
  shape: number[];
1403
1568
  mode: "xor" | 0 | 1;
@@ -1573,6 +1738,7 @@ declare abstract class Tracer {
1573
1738
  neg(): this;
1574
1739
  add(other: this | TracerValue): this;
1575
1740
  mul(other: this | TracerValue): this;
1741
+ mod(other: this | TracerValue): this;
1576
1742
  greater(other: this | TracerValue): this;
1577
1743
  less(other: this | TracerValue): this;
1578
1744
  equal(other: this | TracerValue): this;
@@ -1675,6 +1841,7 @@ declare class ShapedArray implements AbstractValue {
1675
1841
  static fromAval(aval: AbstractValue): ShapedArray;
1676
1842
  get ndim(): number;
1677
1843
  get size(): number;
1844
+ scalar(): ShapedArray;
1678
1845
  toString(): string;
1679
1846
  equals(other: ShapedArray): boolean;
1680
1847
  }
@@ -1742,6 +1909,8 @@ declare class Array extends Tracer {
1742
1909
  toString(): string;
1743
1910
  get device(): Device;
1744
1911
  get ref(): this;
1912
+ /** Get the current reference count (for debugging memory management). */
1913
+ get refCount(): number;
1745
1914
  dispose(): void;
1746
1915
  /**
1747
1916
  * Convert this array into a primitive value.
@@ -1890,8 +2059,25 @@ declare function linspace(start: number, stop: number, num?: number, endpoint?:
1890
2059
  dtype,
1891
2060
  device
1892
2061
  }?: DTypeAndDevice): Array;
2062
+ /**
2063
+ * Return numbers spaced evenly on a log scale.
2064
+ *
2065
+ * In linear space, the sequence starts at `base ** start` and ends at
2066
+ * `base ** stop` (see `endpoint` below).
2067
+ *
2068
+ * @param start - `base ** start` is the starting value of the sequence.
2069
+ * @param stop - `base ** stop` is the final value of the sequence, unless `endpoint` is false.
2070
+ * @param num - Number of samples to generate. Default is 50.
2071
+ * @param endpoint - If true, `stop` is the last sample. Otherwise, it is not included. Default is true.
2072
+ * @param base - The base of the log space. Default is 10.
2073
+ * @returns Array of evenly spaced values on a log scale.
2074
+ */
2075
+ declare function logspace(start: number, stop: number, num?: number, endpoint?: boolean, base?: number, {
2076
+ dtype,
2077
+ device
2078
+ }?: DTypeAndDevice): Array;
1893
2079
  declare namespace lax_linalg_d_exports {
1894
- export { cholesky, triangularSolve };
2080
+ export { cholesky, lu, triangularSolve };
1895
2081
  }
1896
2082
  /**
1897
2083
  * Compute the Cholesky decomposition of a symmetric positive-definite matrix.
@@ -1924,6 +2110,32 @@ declare function cholesky(a: ArrayLike, {
1924
2110
  }?: {
1925
2111
  upper?: boolean;
1926
2112
  }): Array;
2113
+ /**
2114
+ * LU decomposition with partial pivoting.
2115
+ *
2116
+ * Computes the matrix decomposition: `P @ A = L @ U`, where `P` is a
2117
+ * permutation of the rows of `A`, `L` is lower-triangular with unit diagonal,
2118
+ * and `U` is upper-triangular.
2119
+ *
2120
+ * @param x - A batch of matrices with shape `[..., m, n]`.
2121
+ *
2122
+ * @returns A tuple `(lu, pivots, permutation)` where:
2123
+ * - `lu`: combined lower and upper triangular matrices.
2124
+ * - `pivots`: an array of pivot indices with shape `[..., min(m, n)]`.
2125
+ * - `permutation`: the permutation generated by pivots with shape `[..., m]`.
2126
+ *
2127
+ * @example
2128
+ * ```ts
2129
+ * import { lax, numpy as np } from "@jax-js/jax";
2130
+ *
2131
+ * const A = np.array([[4., 3.], [6., 3.]]);
2132
+ * const [lu, pivots, permutation] = lax.linalg.lu(A);
2133
+ * // lu ≈ [[6., 3.], [0.6666667, 1.0]]
2134
+ * // pivots = [1, 1]
2135
+ * // permutation = [1, 0]
2136
+ * ```
2137
+ */
2138
+ declare function lu(x: ArrayLike): [Array, Array, Array];
1927
2139
  /**
1928
2140
  * Solve a triangular linear system.
1929
2141
  *
@@ -2224,10 +2436,10 @@ declare function standardize(x: ArrayLike, axis?: Axis, opts?: {
2224
2436
  */
2225
2437
  declare function oneHot(x: Array, numClasses: number): Array;
2226
2438
  declare namespace random_d_exports {
2227
- export { bernoulli, bits, cauchy, exponential, gumbel, key, laplace, normal, split, uniform };
2439
+ export { bernoulli, bits, cauchy, exponential, gumbel, key, laplace, multivariateNormal, normal, split, uniform };
2228
2440
  }
2229
2441
  /** Create a pseudo-random number generator (PRNG) key from 32-bit integer seed. */
2230
- declare function key(seed: number): Array;
2442
+ declare function key(seed: ArrayLike): Array;
2231
2443
  /** Splits a PRNG key into `num` new keys by adding a leading axis. */
2232
2444
  declare function split(key: Array, num?: number | number[]): Array;
2233
2445
  /** Sample uniform bits in the form of unsigned integers. */
@@ -2274,6 +2486,23 @@ declare const gumbel: OwnedFunction<(key: ArrayLike, shape?: number[] | undefine
2274
2486
  * Inverting: `x = -sign(u - 0.5) * log(1 - 2 * |u - 0.5|)`.
2275
2487
  */
2276
2488
  declare const laplace: OwnedFunction<(key: ArrayLike, shape?: number[] | undefined) => Array>;
2489
+ /**
2490
+ * @function
2491
+ * Sample multivariate normal random values with given mean and covariance.
2492
+ *
2493
+ * The values are returned with the given shape, along with the final dimension
2494
+ * used to represent the n-dimensional multivariate normal factors.
2495
+ *
2496
+ * This uses Cholesky decomposition on the covariance matrix.
2497
+ *
2498
+ * - `key` - PRNG key
2499
+ * - `mean` - Mean vector of shape `[..., n]`
2500
+ * - `cov` - Covariance of shape `[..., n, n]`, must be positive-definite
2501
+ * - `shape` - Result batch shape, must be broadcastable with
2502
+ * `mean.shape[:-1]` and `cov.shape[:-2]`
2503
+ * @returns Random samples of shape `[...shape, n]`
2504
+ */
2505
+ declare const multivariateNormal: OwnedFunction<(key: ArrayLike, mean: ArrayLike, cov: ArrayLike, shape?: number[] | undefined) => Array>;
2277
2506
  /**
2278
2507
  * @function
2279
2508
  * Sample random values according to `p(x) = 1/sqrt(2pi) * exp(-x^2/2)`.