espresso-infer
Minimal runnable CLI demonstrating Apple Espresso inference via github.com/tmc/apple/x/espresso.
By default, espresso-infer writes a self-contained single-layer ReLU network (x -> y, shape [4 1 1 1]) to a temporary directory, runs inference, prints the resolved backend, blob dimensions, input vector, and output vector, and cleans up on exit. Pass -net to load an existing .espresso.net file instead.
Modes
plan (default): uses the C-API execution path (OpenPlan -> AddNetwork -> Build -> QueryBlobDimensions -> BindInputBuffer/BindOutputBuffer -> ExecuteSync).
eval: uses the high-level Context/Frame path (Open -> LoadNetworkFromFile -> NewFrame -> SetInput -> Eval -> Output).
Usage
go run ./examples/espresso/espresso-infer -platform cpu -mode plan
go run ./examples/espresso/espresso-infer -platform gpu -mode plan
go run ./examples/espresso/espresso-infer -platform cpu -mode eval
go run ./examples/espresso/espresso-infer -platform gpu -mode eval
Flags:
-platform: cpu (default), gpu, ane, or auto
-mode: plan (default) or eval
-net: optional path to an .espresso.net file