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

Fix tensor inheritance #451

Merged
merged 5 commits into from
Dec 12, 2023
Merged

Fix tensor inheritance #451

merged 5 commits into from
Dec 12, 2023

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Dec 11, 2023

fixes #437

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@xenova
Copy link
Collaborator Author

xenova commented Dec 11, 2023

cc @kungfooman - I'd appreciate a review before I merge.

src/utils/tensor.js Outdated Show resolved Hide resolved
src/utils/tensor.js Outdated Show resolved Hide resolved
@xenova
Copy link
Collaborator Author

xenova commented Dec 12, 2023

Thanks @kungfooman! Applied the suggestions now. I've left the DataTypeMap variable uppercase since that's how it's defined in onnxruntime. I also just added a simple hasOwnProperty just to avoid weird cases like the user passing "toString" as the data type.

@kungfooman
Copy link
Contributor

Very nice changes, thank you @xenova! I looked over it again and run npm run typegen produces this any type right now:

image

Otherwise I'm very happy about your work here 🥇

@xenova
Copy link
Collaborator Author

xenova commented Dec 12, 2023

@kungfooman Great :) I've fixed that type now too 👍 lmk if I can merge and put out a new release :)

@kungfooman
Copy link
Contributor

@kungfooman Great :) I've fixed that type now too 👍 lmk if I can merge and put out a new release :)

Very nice, PR looks very good! (famous last words) - I can't see any problems or errors in the type declaration files any longer

@xenova xenova merged commit 8c465a9 into main Dec 12, 2023
4 checks passed
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.

error TS2510: Base constructors must all have the same return type.
3 participants