In this article
Unknown extent, unknown rank and a concrete empty dimension describe different contracts; shape inference must preserve those distinctions.
An inspector replaces uncertainty with a concrete value
A model viewer encounters an output dimension without a known integer extent. A downstream script fills the missing value with zero so that its table contains only numbers. The resulting allocation logic now treats an unresolved dimension as an empty tensor. That change does not improve inference; it invents a contract the graph never declared. Keep uncertainty explicit until an input constraint or runtime result supplies the missing information.
Rank and extent have separate representations
The ONNX shape inference guide distinguishes unknown rank, symbolic extent and anonymous unknown extent. A repeated symbolic name can express a shared unknown quantity. It is not a numeric estimate and should not be discarded merely to simplify a report. Read the full shape structure before allocating buffers or comparing interfaces, including whether a shape exists at all and which dimensions actually have concrete values.
Propagation is not arbitrary algebraic reasoning
The shape inference API exposes inference and checking options. The available reasoning depends on operator support and the information present in the graph. A dynamically computed reshape can leave output information incomplete without making the model invalid. The tensor descriptor guide explains the related distinction between dimensions and physical layout; inferring an extent does not by itself specify every storage detail used by a device implementation.
Use the operator contract to interpret gaps
The Reshape specification is relevant when target dimensions are supplied as data. Determine whether an unresolved output follows from runtime values, a missing inference implementation or insufficient annotations. These are different explanations and suggest different next steps. Preserve the original graph and inspect a concrete execution alongside inferred metadata. Do not patch annotations simply to make a viewer display a fully numeric shape.
Validate the consumer’s assumptions explicitly
An adapter that requires fixed extents should reject an unresolved shape or request a supported specialization. It should not silently assume that unknown means empty, singleton or equal to a previous request. Include changed sequence lengths and genuinely empty inputs where the model supports them. The explicit schema guide offers the same discipline for ingestion: absence of a constraint is not evidence for a convenient default. Record which assumptions come from the model and which are imposed by the adapter.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.