-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Expose the extension operators for Tensor, TensorSpan, and ROTensorSpan #117997
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
Conversation
Tagging subscribers to this area: @dotnet/area-system-numerics-tensors |
src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs
Outdated
Show resolved
Hide resolved
… that are not on methods so the analyzer doesn't throw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds extension operator support for tensor types (Tensor, TensorSpan, and ReadOnlyTensorSpan) in the System.Numerics.Tensors library. The changes implement arithmetic, bitwise, and shift operators through the C# extension operators feature.
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 10 comments.
Show a summary per file
File | Description |
---|---|
TrimAnalysisVisitor.cs | Adds handling for extension member parameters in the trim analysis visitor |
TensorPrimitives.ShiftRightLogical.cs | Adds new file implementing logical right shift operation for tensor primitives |
TensorPrimitives.ShiftRightArithmetic.cs | Adds new file implementing arithmetic right shift operation for tensor primitives |
TensorPrimitives.ShiftLeft.cs | Refactors to remove arithmetic/logical right shift implementations, keeping only left shift |
TensorOperation.cs | Adds operation structs for increment, decrement, and shift operations |
Tensor.op_*.cs files (15 files) | Adds operator overloads as extension operators for various tensor types |
Tensor.cs | Removes duplicate method implementations that are now handled by the operator files |
System.Numerics.Tensors.csproj | Adds new operator files to the compilation |
CompatibilitySuppressions.xml | Adds suppressions for compatibility analyzer |
System.Numerics.Tensors.netcore.cs | Adds extension operator declarations to the reference assembly |
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Division.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Division.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Division.cs
Outdated
Show resolved
Hide resolved
...braries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Subtraction.cs
Outdated
Show resolved
Hide resolved
...braries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Subtraction.cs
Outdated
Show resolved
Hide resolved
...braries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Subtraction.cs
Outdated
Show resolved
Hide resolved
...libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Decrement.cs
Outdated
Show resolved
Hide resolved
...libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Decrement.cs
Outdated
Show resolved
Hide resolved
...libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Increment.cs
Outdated
Show resolved
Hide resolved
...libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.op_Increment.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
We're waiting on the Roslyn metadata changes from dotnet/dotnet#1763 before merging this, just to help assert we're not going to end up with some ref assembly or tooling conflict |
This resolves #112781