{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "cf2246a7ad439fa38d57462118e7840e5497a685",
    "tool": "pyref",
    "version": "1.7.3"
  },
  "language": "python",
  "modules": [
    {
      "description": "",
      "name": "shape_propagation",
      "path": "helia_aot.air.shape_propagation",
      "submodules": [],
      "summary": "",
      "symbols": [
        {
          "description": "Base type for shape propagation rule outcomes.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.ShapeRuleResult",
          "kind": "class",
          "language": "python",
          "members": [],
          "name": "ShapeRuleResult",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "ShapeRuleResult()",
          "source": {
            "line": 55,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L55"
          },
          "summary": "Base type for shape propagation rule outcomes."
        },
        {
          "description": "`dataclass`\n\nRule does not own this operator case and generic fallback may run.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.NotApplicable",
          "kind": "class",
          "language": "python",
          "members": [],
          "name": "NotApplicable",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "NotApplicable() -> None",
          "source": {
            "line": 59,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L59"
          },
          "summary": "Rule does not own this operator case and generic fallback may run."
        },
        {
          "description": "`dataclass`\n\nRule produced concrete output shape updates.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.Updated",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.Updated.shapes",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "shapes",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "shapes: dict[str, tuple[int, ...]]",
              "source": {
                "line": 68,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L68"
              },
              "summary": ""
            }
          ],
          "name": "Updated",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "Updated(shapes: dict[str, tuple[int, ...]]) -> None",
          "source": {
            "line": 64,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L64"
          },
          "summary": "Rule produced concrete output shape updates."
        },
        {
          "description": "`dataclass`\n\nRule owns this operator case and no shape update is required.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.NoUpdate",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.NoUpdate.reason",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "reason",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "reason: str = ''",
              "source": {
                "line": 79,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L79"
              },
              "summary": ""
            }
          ],
          "name": "NoUpdate",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "NoUpdate(reason: str = '') -> None",
          "source": {
            "line": 75,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L75"
          },
          "summary": "Rule owns this operator case and no shape update is required."
        },
        {
          "description": "`dataclass`\n\nRule owns this operator case and cannot safely infer an update.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.Blocked",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.Blocked.reason",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "reason",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "reason: str",
              "source": {
                "line": 86,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L86"
              },
              "summary": ""
            }
          ],
          "name": "Blocked",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "Blocked(reason: str) -> None",
          "source": {
            "line": 82,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L82"
          },
          "summary": "Rule owns this operator case and cannot safely infer an update."
        },
        {
          "description": "`dataclass`\n\nShape propagation outcome.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.ShapeInferenceResult",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Tensor IDs whose shapes changed during propagation.",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.ShapeInferenceResult.changed_tensor_ids",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "changed_tensor_ids",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "changed_tensor_ids: set[str] = field(default_factory=set)",
              "source": {
                "line": 114,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L114"
              },
              "summary": ""
            },
            {
              "description": "Tensor IDs whose shapes a rule computed from proven\noperands, whether or not the stored shape changed, plus concrete graph\ninputs with a dynamic signature. A dynamic-signature tensor whose\ninferred shape already matched is resolved, not unresolved.",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.ShapeInferenceResult.confirmed_tensor_ids",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "confirmed_tensor_ids",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "confirmed_tensor_ids: set[str] = field(default_factory=set)",
              "source": {
                "line": 115,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L115"
              },
              "summary": ""
            },
            {
              "description": "Shape-expression tensors whose compile-time value\npropagation computed and stored in ``AirTensor.inferred_value``.",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.ShapeInferenceResult.evaluated_tensor_ids",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "evaluated_tensor_ids",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "evaluated_tensor_ids: set[str] = field(default_factory=set)",
              "source": {
                "line": 116,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L116"
              },
              "summary": ""
            },
            {
              "description": "Dynamic tensor IDs that remain unresolved.",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.ShapeInferenceResult.unresolved_tensor_ids",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "unresolved_tensor_ids",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "unresolved_tensor_ids: set[str] = field(default_factory=set)",
              "source": {
                "line": 117,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L117"
              },
              "summary": ""
            },
            {
              "description": "Unresolved tensor IDs whose inferred shape\nconflicted with their declared contract while computed from an\nunresolved operand. Such a shape can come from a placeholder, so the\nupdate was dropped rather than raised.",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.ShapeInferenceResult.deferred_conflict_tensor_ids",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "deferred_conflict_tensor_ids",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "deferred_conflict_tensor_ids: set[str] = field(default_factory=set)",
              "source": {
                "line": 118,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L118"
              },
              "summary": ""
            },
            {
              "description": "Human-readable diagnostics describing inference updates and unresolved\ntensors. Skip diagnostics (rule/fallback skipped) are only included when DEBUG\nlogging is enabled to avoid unbounded growth on large graphs.",
              "examples": [],
              "id": "helia_aot.air.shape_propagation.ShapeInferenceResult.diagnostics",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "diagnostics",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "diagnostics: list[str] = field(default_factory=list)",
              "source": {
                "line": 119,
                "path": "helia_aot/air/shape_propagation.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L119"
              },
              "summary": ""
            }
          ],
          "name": "ShapeInferenceResult",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "ShapeInferenceResult(\n    changed_tensor_ids: set[str] = set(),\n    confirmed_tensor_ids: set[str] = set(),\n    evaluated_tensor_ids: set[str] = set(),\n    unresolved_tensor_ids: set[str] = set(),\n    deferred_conflict_tensor_ids: set[str] = set(),\n    diagnostics: list[str] = list(),\n) -> None",
          "source": {
            "line": 92,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L92"
          },
          "summary": "Shape propagation outcome."
        },
        {
          "description": "Infer tensor shapes and shape-expression values over the graph until fixed point.\n\nShapes and values depend on each other: ``SHAPE`` turns a tensor's shape\ninto a value, and a RESHAPE turns its target value back into a shape. Both\nare facts in the same worklist, so a chain of any depth resolves without a\nfixed pass order. Values are computed only for ``SHAPE`` and for\nSTRIDED_SLICE and PACK nodes over shape-derived tensors (see\n``shape_expressions``), and only from proven shapes, so a placeholder can\nnever become a value. A shape the model declares fully static counts as\nproven, so a value can come from declared metadata as well as from the\ngraph-input shapes. Each value is stored in ``AirTensor.inferred_value``,\nnever in ``data``, and the graph structure is left unchanged;\n``FoldStaticShapeExpressions`` turns the values into constants afterwards.",
          "examples": [],
          "id": "helia_aot.air.shape_propagation.propagate_shapes",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "propagate_shapes",
          "params": [
            {
              "description": "AIR model to update in place.",
              "name": "model",
              "type": "AirModel"
            },
            {
              "default": "False",
              "description": "If True, raise when unresolved dynamic tensors remain.",
              "name": "strict",
              "type": "bool"
            },
            {
              "default": "True",
              "description": "If True, log unresolved tensors when not raising.",
              "name": "warn_unresolved",
              "type": "bool"
            }
          ],
          "raises": [
            {
              "description": "If ``strict`` is True and unresolved dynamic\ntensors remain, or if a shape or value computed from proven inputs\ncontradicts a tensor's declared contract.",
              "type": "UnsupportedModelError"
            },
            {
              "description": "If an operator's options type does not match its shape\nrule's contract, or a rule returns an unknown result type.",
              "type": "TypeError"
            }
          ],
          "returns": [
            {
              "description": "Shape inference result with updated tensors and diagnostics.",
              "type": "ShapeInferenceResult"
            }
          ],
          "signature": "propagate_shapes(model: AirModel, *, strict: bool = False, warn_unresolved: bool = True) -> ShapeInferenceResult",
          "source": {
            "line": 1273,
            "path": "helia_aot/air/shape_propagation.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/air/shape_propagation.py#L1273"
          },
          "summary": "Infer tensor shapes and shape-expression values over the graph until fixed point."
        }
      ]
    }
  ],
  "name": "helia_aot"
}
