Skip to content

Document Tensor storage contracts and NumPy differences - #56291

Merged
tannergooding merged 3 commits into
dotnet:mainfrom
tannergooding:tannergooding-studious-dollop
Oct 6, 2026
Merged

tannergooding merged 3 commits into
dotnet:mainfrom
tannergooding:tannergooding-studious-dollop

Conversation

@tannergooding

@tannergooding tannergooding commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Document the Tensor storage contracts and intentional NumPy differences introduced or clarified by dotnet/runtime#134914:

  • Add the compatibility article for unsupported overlapping layouts, repeated-storage destinations, and array element-type validation, with explicit snapshot migration guidance.
  • Add a conceptual Tensor guide covering empty shapes, scalar-like squeeze results, nonnegative strides, default-filled resizing, and operation-specific overlap support.
  • Link the guide from the numerics overview and fundamentals navigation, and add the compatibility article to the version index and compatibility navigation.

The runtime changes have merged to main, and dotnet/runtime#135281 proposes the backport to release/11.0. This PR places the breaking-change article and index entry under .NET 11. It covers conceptual and compatibility documentation; API-reference XML belongs to the separate dotnet/dotnet-api-docs repository.

Content sources

The conceptual shape, squeeze, reversal, resize, and empty-stride explanations are adapted from the runtime Tensor README. The overlap table and migration guidance are adapted from the implementation and revised IReadOnlyTensor<TSelf, T> contract. The compatibility article is adapted from #56290. Examples, navigation entries, and the .NET 11 index are newly generated. Please review the operation-specific contracts and .NET 11 release placement.

Validation

Markdownlint reports no issues across all four changed articles. Relative Markdown links and 17 Tensor API cross-references resolve against the source files and API-reference XML.

Built and ran the examples against the accepted runtime implementation at c431dcd84450420a08e07edf94c3be3ecf5988a6:

Example Verified result
First-axis reversal [3, 4, 1, 2]
Explicit snapshot [1, 2, 4, 5]
Copy from the snapshot Destination receives [1, 2, 4, 5]
Unsupported overlapping copy ArgumentException; backing storage remains [1, 2, 3, 4, 5, 6]

OpenPublishing validation will run on this PR.

Resolves #56290

Note

This pull request was generated with GitHub Copilot.


Internal previews

File Preview link
docs/core/compatibility/11.md Learn preview
docs/core/compatibility/core-libraries/11/tensor-storage-layout-validation.md Learn preview
docs/core/compatibility/toc.yml Learn preview
docs/fundamentals/toc.yml Learn preview
docs/standard/numerics.md Learn preview
docs/standard/tensor-shapes-and-storage.md Learn preview

Build report

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

Copilot review overview

🟡 Changes recommended

The release placement remains unconfirmed while the associated runtime change is unmerged.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Documents Tensor shape and storage contracts, NumPy differences, and related breaking changes.

Changes:

  • Adds conceptual Tensor guidance and migration examples.
  • Documents storage-layout validation changes.
  • Adds overview and navigation links.
File Description
docs/​standard/​tensor-shapes-and-storage.md Adds Tensor guidance.
docs/​standard/​numerics.md Links the new guide.
docs/​fundamentals/​toc.yml Adds fundamentals navigation.
docs/​core/​compatibility/​toc.yml Adds .NET 12 navigation.
docs/​core/​compatibility/​core-libraries/​12/​tensor-storage-layout-validation.md Documents the breaking change.
docs/​core/​compatibility/​12.md Adds the .NET 12 index.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/core/compatibility/core-libraries/12/tensor-storage-layout-validation.md Outdated
Comment thread docs/core/compatibility/core-libraries/12/tensor-storage-layout-validation.md Outdated
Comment thread docs/core/compatibility/core-libraries/12/tensor-storage-layout-validation.md Outdated
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Comment thread docs/core/compatibility/core-libraries/12/tensor-storage-layout-validation.md Outdated
Comment thread docs/core/compatibility/core-libraries/12/tensor-storage-layout-validation.md Outdated
Comment thread docs/core/compatibility/core-libraries/12/tensor-storage-layout-validation.md Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tannergooding

Copy link
Copy Markdown
Member Author

@gewarren updated to indicate it targets .NET 11 as the backport was approved

@gewarren gewarren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@tannergooding
tannergooding merged commit 31b054e into dotnet:main Oct 6, 2026
10 checks passed
@tannergooding
tannergooding deleted the tannergooding-studious-dollop branch October 6, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Breaking change]: Tensor operations reject unsupported storage layouts

3 participants