# mlx.core.random.gumbel — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.random.gumbel

mlx.core.random.gumbel(shape: List[ int ] = [], dtype: Optional[ Dtype ] = mlx.core.float32, stream: Optional[ array ] = None, key: Union[ None , Stream , Device ] = None) → array

  Sample from the standard Gumbel distribution.

  The values are sampled from a standard Gumbel distribution which CDF `exp(-exp(-x))`.

  Parameters:

    - shape (list ( int )) – The shape of the output.

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

  Returns:

    The `array` with shape `shape` and

      distributed according to the Gumbel distribution

  Return type:

    array