Function rand

  • Generate a uniform distribution.

    Remarks

    For a normal (Gaussian) distribution, see randn.

    Example

      // 128x8 uniformly random tensor
    const t = sm.rand([128, 8])

    Returns

    A new Tensor of uniformly random values

    Parameters

    • shape: BigInt64Array | number[]

      The shape of the output Tensor

    Returns Tensor

Generated using TypeDoc