Skip to main content

execute_single

Function execute_single 

Source
pub fn execute_single<B: Backend + ?Sized>(
    backend: &B,
    op_type: &str,
    inputs: &[&B::Tensor],
    attributes: Vec<AttributeProto>,
) -> Result<B::Tensor, B::Error>
Expand description

Default body for every per-op method on Backend — wraps the op in a one-node GraphProto and routes through Backend::execute. Backends that override execute natively (graph-compiling backends) get the per-op surface free; backends that override the per-op methods directly bypass this helper entirely.

attributes carries the ONNX-style per-op attributes the typed per-op signatures encode (ReduceSum’s axes + keepdims, Reshape’s shape, etc.). The walker decodes them back via attr_ints / attr_int / attr_tensor before calling the typed per-op method on the backend.