Show operator determinism in generated operator docs - #4
Open
strimo378 wants to merge 3 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surface the existing
OpSchema.node_determinismproperty in the generated operator documentation:docs/docsgen/source/onnx_sphinx.py: add adeterminismentry to the property list at the top of each Sphinx operator page (onnx.ai), next tosupport_levelandshape inference.onnx/defs/gen_doc.py: render a compactDeterminism: ...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).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