mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
13
mlx/random.h
13
mlx/random.h
@@ -254,4 +254,17 @@ inline array laplace(
|
||||
return laplace(shape, float32, 0.0, 1.0, key, s);
|
||||
}
|
||||
|
||||
/* Randomly permute the elements of x along the given axis. */
|
||||
array permutation(
|
||||
const array& x,
|
||||
int axis = 0,
|
||||
const std::optional<array>& key = std::nullopt,
|
||||
StreamOrDevice s = {});
|
||||
|
||||
/* A random permutation of `arange(x)` */
|
||||
array permutation(
|
||||
int x,
|
||||
const std::optional<array>& key = std::nullopt,
|
||||
StreamOrDevice s = {});
|
||||
|
||||
} // namespace mlx::core::random
|
||||
|
||||
Reference in New Issue
Block a user