Splits a PRNG key into `num` new keys by adding a leading axis. Args: key: a PRNG key (from ``key``, ``split``, ``fold_in``). num: optional, a positive integer (or tuple of integers) indicating the number (or shape) of keys to produce. Defaults to 2. Returns: An array-like ob
(key: ArrayLike, num: int | tuple[int, ...] = 2)
| 317 | return prng.random_split(key, shape=shape) |
| 318 | |
| 319 | def split(key: ArrayLike, num: int | tuple[int, ...] = 2) -> Array: |
| 320 | """Splits a PRNG key into `num` new keys by adding a leading axis. |
| 321 | |
| 322 | Args: |
| 323 | key: a PRNG key (from ``key``, ``split``, ``fold_in``). |
| 324 | num: optional, a positive integer (or tuple of integers) indicating |
| 325 | the number (or shape) of keys to produce. Defaults to 2. |
| 326 | |
| 327 | Returns: |
| 328 | An array-like object of `num` new PRNG keys. |
| 329 | """ |
| 330 | typed_key, wrapped = _check_prng_key("split", key) |
| 331 | return _return_prng_keys(wrapped, _split(typed_key, num)) |
| 332 | |
| 333 | |
| 334 | def _key_impl(keys: Array) -> PRNGImpl: |
no test coverage detected
searching dependent graphs…