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

Skip to main content
`Ctrl`+`K`

# mlx.core.random.split

mlx.core.random.split(key: array, num: int = 2, stream: Union[ None , Stream , Device ] = None) → array

  Split a PRNG key into sub keys.

  Parameters:

    - key (array) – Input key to split.

    - num (int , optional) – Number of sub keys. Default is 2.

  Returns:

    The array of sub keys with `num` as its first dimension.

  Return type:

    array