Skip to content

Show operator determinism in generated operator docs - #4

Open
strimo378 wants to merge 3 commits into
mainfrom
claude/operator-determinism-docs
Open

Show operator determinism in generated operator docs#4
strimo378 wants to merge 3 commits into
mainfrom
claude/operator-determinism-docs

Conversation

@strimo378

Copy link
Copy Markdown

Surface the existing OpSchema.node_determinism property in the generated operator documentation:

  • docs/docsgen/source/onnx_sphinx.py: add a determinism entry to the property list at the top of each Sphinx operator page (onnx.ai), next to support_level and shape inference.
  • onnx/defs/gen_doc.py: render a compact Determinism: ... line in the version block of each operator section, stating whether the operator is deterministic, non-deterministic (may depend on random number generation or subgraphs), or unknown (cannot be statically determined).
  • Regenerate docs/Operators.md, docs/Operators-ml.md, docs/Changelog.md, docs/Changelog-ml.md.

Motivation and Context

The operator pages (e.g. https://onnx.ai/onnx/operators/onnx__Bernoulli.html) do not show whether an operator depends on random numbers, even though the schema carries this information via node_determinism. Companion PR #1 exposes the same property in the Python type stubs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QpYnitZpNfAkgkLb1o81NS


Generated by Claude Code

claude added 3 commits July 5, 2026 23:00
Add a 'Determinism' section to the Markdown operator docs generated by
gen_doc.py and a 'determinism' bullet to the Sphinx operator pages
(onnx.ai), so the node_determinism property of each operator schema
(e.g. Bernoulli, RandomNormal, Dropout) is visible in the documentation.
Regenerate docs/Operators.md, docs/Operators-ml.md, docs/Changelog.md
and docs/Changelog-ml.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpYnitZpNfAkgkLb1o81NS
Signed-off-by: Claude <noreply@anthropic.com>
Instead of a separate 'Determinism' section, render the determinism of
each operator as a single line in the version block of Operators.md and
Changelog.md, matching the compact property-list style of the Sphinx
operator pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpYnitZpNfAkgkLb1o81NS
Signed-off-by: Claude <noreply@anthropic.com>
GetNodeDeterminism() also returns Unknown when a sub-operator of a
static function body cannot be resolved in the schema registry, not
only for context-dependent function bodies, so use a wording that
covers all cases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpYnitZpNfAkgkLb1o81NS
Signed-off-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants