Skip to content
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

[Feature Request] Implement IEquatable<T> on OrtTensorTypeAndShapeInfo #21751

Open
vpenades opened this issue Aug 15, 2024 · 0 comments
Open
Labels
feature request request for unsupported feature or enhancement

Comments

@vpenades
Copy link

Describe the feature request

it would be useful in some scenarios that OrtTensorTypeAndShapeInfo implements IEquatable<T> and associated GetHashCode to compare instances

struct OrtTensorTypeAndShapeInfo : IEquatable<OrtTensorTypeAndShapeInfo>
{
...
}

Describe scenario use case

I've found myself in a situation in which I have, I am using a Dictionary<OrtTensorTypeAndShapeInfo, LAMBDA> where the lambda is a specific funcion that knows how to operate on a tensor of that specific type and shape.

Unfortunately, because the OrtTensorTypeAndShapeInfo has a Shape array, the default equality is comparing the instances of the arrays and not the contents of the shape arrays.

implementing IEquality would fix that.

@vpenades vpenades added the feature request request for unsupported feature or enhancement label Aug 15, 2024
@github-actions github-actions bot added the api:CSharp issues related to the C# API label Aug 15, 2024
@sophies927 sophies927 removed the api:CSharp issues related to the C# API label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants