Skip to content

Conversation

tannergooding
Copy link
Member

This resolves #112781

@dotnet-policy-service dotnet-policy-service bot added the linkable-framework Issues associated with delivering a linker friendly framework label Jul 23, 2025
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.

… that are not on methods so the analyzer doesn't throw
@tannergooding tannergooding marked this pull request as ready for review August 3, 2025 13:32
@Copilot Copilot AI review requested due to automatic review settings August 3, 2025 13:32
@tannergooding tannergooding requested a review from sbomer as a code owner August 3, 2025 13:32
Copy link
Contributor

@Copilot Copilot AI left a 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

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

🥳

@tannergooding
Copy link
Member Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Numerics.Tensors linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Tensor Operators
3 participants