espresso-infer

command
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

Documentation

Rendered for darwin/amd64

Overview

Command espresso-infer runs a minimal Espresso neural network using github.com/tmc/apple/x/espresso.

By default it writes a self-contained single-layer ReLU network to a temporary directory, runs inference on the selected backend, prints the blob dimensions and input/output vectors, and removes the temporary files on exit. Pass -net to load an existing .espresso.net file instead.

Usage:

espresso-infer [-platform cpu|gpu|ane|auto] [-mode plan|eval] [-net path]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL