Skip to main content

Module shape

Module shape 

Source
Expand description

Symbolic shape inference over the shared runtime IR (ONNX_RS §9).

This module is a thin standard-library wrapper around onnx_runtime_shape_inference. It does not duplicate operator rules: infer_shapes uses the crate’s built-in InferenceRegistry, while infer_shapes_with_registry accepts a caller-supplied registry containing custom rules.

Structs§

DimExpr
A canonical integer polynomial over symbolic dimensions.
InferenceContext
The context passed to every op inference rule.
InferenceRegistry
A registry mapping (domain, op_type, opset) to an InferenceFn.
NodeIo
The resolved inference state of a single input or output slot: an optional type and an optional ShapeData side-value.
ShapeData
The known element values of a rank-0 or rank-1 integer tensor flowing through a shape-computation subgraph.
ShapeInferenceResult
Summary of a whole-model shape-inference run.
TypeInfo
The inferred type of a value: element dtype plus a symbolic shape.

Enums§

MergePolicy
How to reconcile an inferred shape with a value’s declared shape.
ShapeError
An error produced while inferring shapes.

Functions§

infer_shapes
Infer value types and shapes with the built-in ONNX operator registry.
infer_shapes_with_registry
Infer value types and shapes with a caller-supplied registry.
register_shape_inference
Register an opset-aware shape-inference function on registry.

Type Aliases§

InferenceFn
An operator inference rule: reads inputs from the InferenceContext and sets its outputs’ types (and, where applicable, shape-data).
TypedShape
An inferred shape: an ordered list of symbolic dimension expressions. The rank is always known (unknown-rank tensors are represented by the absence of a TypeInfo, never by a TypedShape).