mlx.core.random.laplace

目錄

mlx.core.random.laplace#

laplace(shape: Sequence[int] = [], dtype: Dtype | None = float32, loc: float = 0.0, scale: float = 1.0, key: array | None = None, stream: None | Stream | Device = None) array#

從拉普拉斯分佈取樣。

參數:
  • shape (list(int), optional) -- Shape of the output. Default: ().

  • dtype (Dtype, optional) -- Type of the output. Default: float32.

  • loc (float, optional) -- Mean of the distribution. Default: 0.0.

  • scale (float, optional) -- The scale "b" of the Laplace distribution. Default:1.0.

  • key (array, optional) -- A PRNG key. Default: None.

回傳:

The output array of random values.

回傳型別:

array