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] Example wrapper for C# #56

Open
vadimkantorov opened this issue Aug 17, 2020 · 2 comments
Open

[feature request] Example wrapper for C# #56

vadimkantorov opened this issue Aug 17, 2020 · 2 comments

Comments

@vadimkantorov
Copy link

vadimkantorov commented Aug 17, 2020

A related issue in onnxruntime: microsoft/onnxruntime#4162. Not sure where this feature request should belong

There is DenseTensor type in Microsoft ML/onnxruntime. It would be good to have standard example wrapper for converting to and from DLPack. Then users could use the provided structs in their own C# wrappers for their own C function wrappers that accept or return DLPack tensors

A good example of this could be onnxruntime wrapper for C#: https://github.com/microsoft/onnxruntime/blob/3530ce541cbb66f05e523f92b62cebaa4793bd3f/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.cs and https://github.com/microsoft/onnxruntime/tree/3530ce541cbb66f05e523f92b62cebaa4793bd3f/csharp/src/Microsoft.ML.OnnxRuntime

(I may upload a sample wrapper later on, but I don't have it yet)

@vadimkantorov
Copy link
Author

Given that DLPack interface is quite simple, it may be as easy as running automated clang-based C# binding generator https://github.com/microsoft/ClangSharp/tree/master/sources/ClangSharpPInvokeGenerator

@vadimkantorov
Copy link
Author

here is a limited example of such bindings: https://github.com/vadimkantorov/dotnetdlpack

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

No branches or pull requests

1 participant