mlx_random (mlx v0.2.0)

View Source

Summary

Types

array/0

-type array() :: reference().

dtype/0

-type dtype() :: atom().

key/0

-type key() :: reference().

shape/0

-type shape() :: [integer()].

Functions

bernoulli(P)

-spec bernoulli(array()) -> {ok, array()} | {error, term()}.

bernoulli(P, Shape)

-spec bernoulli(array(), shape()) -> {ok, array()} | {error, term()}.

bernoulli(P, Shape, Dtype)

-spec bernoulli(array(), shape(), dtype()) -> {ok, array()} | {error, term()}.

beta(Alpha, Beta)

-spec beta(array(), array()) -> {ok, array()} | {error, term()}.

beta(Alpha, Beta, Shape)

-spec beta(array(), array(), shape()) -> {ok, array()} | {error, term()}.

beta(Alpha, Beta, Shape, Dtype)

-spec beta(array(), array(), shape(), dtype()) -> {ok, array()} | {error, term()}.

categorical(Logits)

-spec categorical(array()) -> {ok, array()} | {error, term()}.

categorical(Logits, Shape)

-spec categorical(array(), shape()) -> {ok, array()} | {error, term()}.

categorical(Logits, Shape, Dtype)

-spec categorical(array(), shape(), dtype()) -> {ok, array()} | {error, term()}.

choice(Array)

-spec choice(array()) -> {ok, array()} | {error, term()}.

choice(Array, Size)

-spec choice(array(), integer()) -> {ok, array()} | {error, term()}.

choice(Array, Size, Replace)

-spec choice(array(), integer(), boolean()) -> {ok, array()} | {error, term()}.

exponential(Lambda)

-spec exponential(array()) -> {ok, array()} | {error, term()}.

exponential(Lambda, Shape)

-spec exponential(array(), shape()) -> {ok, array()} | {error, term()}.

exponential(Lambda, Shape, Dtype)

-spec exponential(array(), shape(), dtype()) -> {ok, array()} | {error, term()}.

gamma(Alpha, Beta)

-spec gamma(array(), array()) -> {ok, array()} | {error, term()}.

gamma(Alpha, Beta, Shape)

-spec gamma(array(), array(), shape()) -> {ok, array()} | {error, term()}.

gamma(Alpha, Beta, Shape, Dtype)

-spec gamma(array(), array(), shape(), dtype()) -> {ok, array()} | {error, term()}.

key(Seed)

-spec key(integer()) -> {ok, key()} | {error, term()}.

multinomial(P, N)

-spec multinomial(array(), integer()) -> {ok, array()} | {error, term()}.

multinomial(P, N, Shape)

-spec multinomial(array(), integer(), shape()) -> {ok, array()} | {error, term()}.

multinomial(P, N, Shape, Dtype)

-spec multinomial(array(), integer(), shape(), dtype()) -> {ok, array()} | {error, term()}.

normal(Shape)

-spec normal(shape()) -> {ok, array()} | {error, term()}.

normal(Shape, Mean)

-spec normal(shape(), number()) -> {ok, array()} | {error, term()}.

normal(Shape, Mean, Std)

-spec normal(shape(), number(), number()) -> {ok, array()} | {error, term()}.

permutation(N)

-spec permutation(integer()) -> {ok, array()} | {error, term()}.

permutation(Array, Axis)

-spec permutation(array(), integer()) -> {ok, array()} | {error, term()}.

poisson(Lambda)

-spec poisson(array()) -> {ok, array()} | {error, term()}.

poisson(Lambda, Shape)

-spec poisson(array(), shape()) -> {ok, array()} | {error, term()}.

poisson(Lambda, Shape, Dtype)

-spec poisson(array(), shape(), dtype()) -> {ok, array()} | {error, term()}.

randint(High, Shape)

-spec randint(integer(), shape()) -> {ok, array()} | {error, term()}.

randint(Low, High, Shape)

-spec randint(integer(), integer(), shape()) -> {ok, array()} | {error, term()}.

randint(Low, High, Shape, Dtype)

-spec randint(integer(), integer(), shape(), dtype()) -> {ok, array()} | {error, term()}.

seed(Seed)

-spec seed(integer()) -> ok | {error, term()}.

shuffle(Array)

-spec shuffle(array()) -> {ok, array()} | {error, term()}.

shuffle(Array, Axis)

-spec shuffle(array(), integer()) -> {ok, array()} | {error, term()}.

uniform(Shape)

-spec uniform(shape()) -> {ok, array()} | {error, term()}.

uniform(Shape, Low)

-spec uniform(shape(), number()) -> {ok, array()} | {error, term()}.

uniform(Shape, Low, High)

-spec uniform(shape(), number(), number()) -> {ok, array()} | {error, term()}.

uniform(Shape, Low, High, Dtype)

-spec uniform(shape(), number(), number(), dtype()) -> {ok, array()} | {error, term()}.