Skip to content

Fix C++ API doc comments for ConstValueImpl and ConstValueInfoImpl - #33604

Open
Jooyoung Lim (mmporong) wants to merge 1 commit into
microsoft:mainfrom
mmporong:fix-cxx-value-hasvalue-getcount-docs
Open

Jooyoung Lim (mmporong) wants to merge 1 commit into
microsoft:mainfrom
mmporong:fix-cxx-value-hasvalue-getcount-docs

Conversation

@mmporong

Copy link
Copy Markdown

Description

Fix Doxygen comment markers in onnxruntime_cxx_api.h that attach descriptions to the wrong member. Doxygen only treats ///< as a trailing comment for the member on the same line:

  • Ort::detail::ConstValueImpl::HasValue() used /// < ... (with a space), which Doxygen reads as a leading comment for the next declaration, so the HasValue text showed up under GetCount() and HasValue had no description. GetCount() used a plain // comment, so its own description never reached the docs. Both now use ///<. The GetCount() wording is shortened slightly ("the element count") to keep the line within 120 columns.
  • Ort::detail::ConstValueInfoImpl used /// < ... on its own line before each member, so every description started with a stray <, and the standalone ///< Wraps OrtApi::ValueInfo_GetProducerNode was attached to the previous member TypeInfo() as its detailed description, leaving GetProducerNode() undocumented. These leading comments now use ///.

Comment-only change; no code or build impact.

Generated XML, Doxygen 1.9.8 (the version used by publish-c-apidocs.yml) with docs/c_cxx/Doxyfile and its inputs:

Member Before After
ConstValueImpl::HasValue (empty) Return true if OrtValue contains data and returns false if the OrtValue is a None.
ConstValueImpl::GetCount < Return true if OrtValue contains data and returns false if the OrtValue is a None If a non tensor, returns 2 for map and N for sequence, where N is the element count.
ConstValueInfoImpl::GetName (and 9 more A wrapper around ... members) < A wrapper around OrtApi::GetValueInfoName A wrapper around OrtApi::GetValueInfoName.
ConstValueInfoImpl::TypeInfo brief "< A wrapper around OrtApi::GetValueInfoTypeInfo", detail "Wraps OrtApi::ValueInfo_GetProducerNode" brief "A wrapper around OrtApi::GetValueInfoTypeInfo.", no detail
ConstValueInfoImpl::GetProducerNode (empty) Wraps OrtApi::ValueInfo_GetProducerNode.

Only the ConstValueImpl and ConstValueInfoImpl XML (and the header's source listing) changed. The Doxygen warning log is the same before and after (the two existing @param 'format' warnings for ORT_CXX_LOGF / ORT_CXX_LOGF_NOEXCEPT). clang-format --style=file --dry-run -Werror passes on the file.

Motivation and Context

Fixes #20931. The issue screenshot shows the GetCount() page with "< Return true if OrtValue contains data and returns false if the OrtValue is a None", which is the HasValue() comment, leading < included. A project contributor noted in the thread that the comment is incorrect and should be updated. The ConstValueInfoImpl comments have the same marker problem, so they are fixed here as well.

AI assistance: this change was prepared with Claude (claude-opus-5-5), which located the cause, made the edit, ran the Doxygen before/after comparison, and drafted this description.

Doxygen only treats "///<" as a trailing comment for the member on the
same line. Several comments in onnxruntime_cxx_api.h used the marker
wrongly, so the generated docs attached text to the wrong member or kept
a stray "<":

- ConstValueImpl::HasValue() used "/// <", which became the description
  of GetCount(), and HasValue was left undocumented. GetCount() used a
  plain "//" comment that never reached the docs.
- ConstValueInfoImpl used "/// < ..." on its own line before each member,
  so every description started with "<", and the standalone
  "///< Wraps OrtApi::ValueInfo_GetProducerNode" was attached to the
  previous member TypeInfo(), leaving GetProducerNode() undocumented.

Use "///<" for the trailing comments and "///" for the leading ones.

Fixes microsoft#20931

Assisted-by: Claude:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 26, 2026 09:57
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The comment-only changes correct documentation attachment without affecting API compatibility or executable behavior.

No open issues 🎉

What changed in this PR

Corrects Doxygen comment attachment in ONNX Runtime’s C++ API header, addressing #20931 without changing API signatures or runtime behavior.

Changes:

  • Fixes trailing documentation markers for HasValue() and GetCount().
  • Corrects leading documentation markers in ConstValueInfoImpl, removing stray < characters and attaching descriptions to the intended members.

No actionable findings remain.

File Description
include/​onnxruntime/​core/​session/​onnxruntime_cxx_api.h Corrects documentation markers and slightly shortens the GetCount() description.

Review effort: Balanced

@mmporong

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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.

[Web] There seems to be some issues with the comments on this document regarding GetCount function

2 participants