Skip to main content

ModelGraph

type ModelGraph struct {
// contains filtered or unexported fields
}

ModelGraph is a `clika_rt_model_graph*` handle (single-owner).

Methods

Close

func (h *ModelGraph) Close()

Close frees the single-owner handle; safe to call twice.

InputNames

func (g *ModelGraph) InputNames() ([]string, error)

InputNames reports the graph's input names, in binding order.

OutputNames

func (g *ModelGraph) OutputNames() ([]string, error)

OutputNames reports the graph's output names, in binding order.

Run

func (g *ModelGraph) Run(inputs []*Tensor) ([]*Tensor, error)

Run executes the graph over inputs (positional, matching ModelGraph.InputNames). The inputs are BORROWED; they stay valid and stay the caller's to release. The returned tensors are caller-owned, one per graph output; Release each when done. (List entries are borrowed while the backing list lives, so each is retained to outlive the list, which is freed here.)