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

Improve ElementType ergonomics #102

Merged
merged 8 commits into from
May 15, 2024
Merged

Improve ElementType ergonomics #102

merged 8 commits into from
May 15, 2024

Conversation

pnehrer
Copy link
Contributor

@pnehrer pnehrer commented May 14, 2024

Minor improvements to ElementType ergonomics:

  • derive Copy, Clone to make it easier to pass around as a type vs. u32
  • derive PartialEq, Eq to make instances comparable
  • implement TryFrom with a custom error
  • implement conversion Into u32
  • implement Display

If you accept, I have a follow-up PR that would change some of the u32 return values to ElementType in Node and Tensor, but this would be a breaking change.

@abrown
Copy link
Contributor

abrown commented May 14, 2024

@pnehrer, thanks again for the contribution! I'm going to merge #99 first since that was sitting in the queue and that might cause you a bit of rebasing headache — hopefully not too much. And feel free to replace those u32s with ElementType since we haven't yet published a version that contains these new 2.0 changes.

@pnehrer
Copy link
Contributor Author

pnehrer commented May 15, 2024

@abrown I resolved the merge conflict and this is now ready to go

Copy link
Contributor

@abrown abrown left a comment

Choose a reason for hiding this comment

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

Makes sense to me — thanks!

@abrown abrown merged commit 0ccb3bf into intel:main May 15, 2024
18 checks passed
@pnehrer
Copy link
Contributor Author

pnehrer commented May 15, 2024

Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants