onyx (onyx v0.1.1)

View Source

Summary

Types

dtype/0

-type dtype() :: f32 | f64 | i32 | i64 | u8.

input_spec/0

-type input_spec() :: {binary(), [integer()], dtype()}.

output_spec/0

-type output_spec() :: {binary(), [integer()], dtype()}.

session/0

-type session() :: #{ref := reference(), inputs := [input_spec()], outputs := [output_spec()]}.

tensor/0

-type tensor() :: {binary(), [integer()], dtype()}.

Functions

load(Path)

-spec load(file:filename()) -> {ok, session()} | {error, term()}.

run(_, Inputs)

-spec run(session(), #{binary() => tensor()}) -> {ok, #{binary() => tensor()}} | {error, term()}.

tensor(Data, Shape, DType)

-spec tensor(binary(), [integer()], dtype()) -> tensor().

to_list(_)

-spec to_list(tensor()) -> [number()].

unload(_)

-spec unload(session()) -> ok.