Torch and numpy interoperability? #394
Replies: 9 comments 11 replies
-
When translating python scripts, I often encounter the need for libraries such as sklearn, and currently I can only go to the reference py implementation for rewriting, which is really tiring. |
Beta Was this translation helpful? Give feedback.
-
TorchSharp's active community has grown significantly since the same time last year. What seems inconceivable which is daily with python is now within reach using dotnet thanks to Torchsharp. YES, we need more discussions. For Accord.NET its license needs to be made available as MIT license. Someone needs to persuade this transition since it is now a public archive. We need to discuss different strategies for how to do that. One of the key reasons why TorchSharp is catching growing traction, in my view, was the decision and active commitment to making the portability from PyTorch to dotnet simpler AND keeping Torchsharp up-to-date with abundant and high coverage tests to demonstrate how to do the portability. We need to learn from this success, to make machine learning for dotnet a more complete experience. |
Beta Was this translation helpful? Give feedback.
-
In your most recent TorchAudio example using TorchSharp: SPEECH COMMAND CLASSIFICATION WITH TORCHAUDIO There are a few Pytorch Numpy interoperability statements waveform.t().numpy()
waveform_first.numpy() Could you please share your views on how would TorchSharp community approach these interoperability statements? Primarily based on the discussion above and the availability of different Numpy for .NET libraries. |
Beta Was this translation helpful? Give feedback.
-
As far as TorchSharp is concerned, the answer is no. We're trying to keep the scope very narrow and clean, so that we can manage it without too many dependencies and with minimal staff. I also would like to see a de facto standard .NET numerics library, but we will not be using TorchSharp as a forcing function. |
Beta Was this translation helpful? Give feedback.
-
Now that we have tensor.from_array(), what is your recommended way to do tensor.to_array Typically, in pytorch, this is tensor.numpy() Any suggestion? Ideally there is a small documentation to guide how best to do |
Beta Was this translation helpful? Give feedback.
-
Tensor.data<T> is what you're looking for. |
Beta Was this translation helpful? Give feedback.
-
FYI: Bridge with NumPyA short documentation section on .NET arrays and tensors.?
|
Beta Was this translation helpful? Give feedback.
-
Is there a plan to support Torch and numpy interoperability in .NET?
Currently, users of Tensorflow.NET use either
The .NET community need Microsoft to support the community to (perhaps) coordinate/prioritize the different efforts of bringing Numpy to .NET.
Beta Was this translation helpful? Give feedback.
All reactions