Skip to content

[release/10.0-preview4] Rewrite of System.Numerics.Tensors to allow for more code sharing, various correctness fixes, and stability improvements #114979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 23, 2025

Backport of #114927 to release/10.0-preview4

/cc @tannergooding

Customer Impact

  • Customer reported
  • Found internally

This backports the rewrite of System.Numerics.Tensors so that it can be included in .NET 10 Preview 4, which is a key preview to get the changes in front of the community.

The rewrite was done in order to fix a number of issues and edge cases found in the initial .NET 9 preview of System.Numerics.Tensors, namely in ensuring that we have consistent and correct handling for tensors of all shapes.

Regression

  • Yes
  • No

This was a preview API in .NET 9.

Testing

Tests were updated to match the expected functionality, additional debug assertions were added to validate correctness, and explanatory comments were added in many locations to help explain both "how" the complex logic works and "why" certain things behave the way they do.

There is still more tests to be added, but they will go into main and are not necessary for the updated preview of System.Numerics.Tensors

Risk

Low. This was purely a preview API and exists "out of band" compared to other library APIs. That is, it requires users to explicitly add a NuGet package reference to get access to these APIs.

tannergooding and others added 30 commits April 23, 2025 22:41
* Refactor Tensor to be more reusable and validate appropriate state

* finishing tensor primitives work

---------

Co-authored-by: Tanner Gooding <[email protected]>
* only couple left

* pausing for food

* fixed rented buffer

* squeeze/unsqueeze

* set slice/ split

* only 2 left
* Fixing Broadcasting Loop

* fixes from pr coments

* squeeze fixed

* unsqueeze

* set slice

* more tensor fies
* stack working

* more tensor tests working

* fix factory create tests
@ghost
Copy link

ghost commented Apr 23, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost
Copy link

ghost commented Apr 23, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
See info in area-owners.md if you want to be subscribed.

@carlossanlop
Copy link
Contributor

Ping me when it's approved by Tactics and ready to merge.

@ericstj ericstj added the Servicing-consider Issue for next servicing release review label Apr 24, 2025
@carlossanlop
Copy link
Contributor

/ba-g Failures are known and unrelated, one of them being: #115018

@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 24, 2025
@carlossanlop carlossanlop merged commit 49efa9b into release/10.0-preview4 Apr 24, 2025
87 of 96 checks passed
@carlossanlop carlossanlop deleted the backport/pr-114927-to-release/10.0-preview4 branch April 24, 2025 22:15
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.

4 participants