You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Python there's tensor.cpu().numpy() function that extracts the data from torch tensor back to something that Python can work with.
TorchSharp tensors don't have the .numpy() method, but also don't provide a proper alternative ... or maybe there is, but it's not documented (at least I didn't find it).
Since dotnet does provide multidimensional array functionality, it would be nice to provide some sort of tensor.toArray<float[,,,]>() functionality.
And in general it would be nice to have a cheat-sheet of what was omitted relative to PyTorch and what the alternatives are.
I just referred to .numpy() as analogous of getting data into a native multidimensional array.
My problem is just that I'm unable to find a clean solution of how to convert tensors into native multidimensiona arrays, which on dotnet would be float[,,,] rather than numpy array.
Probably the solution exists, but it is not documented.
For most other things, searching through PyTorch documentation helps.
But with this, PyTorch recommends .numpy() which is not what one would do in dotnet.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In Python there's
tensor.cpu().numpy()
function that extracts the data from torch tensor back to something that Python can work with.TorchSharp tensors don't have the
.numpy()
method, but also don't provide a proper alternative ... or maybe there is, but it's not documented (at least I didn't find it).Since dotnet does provide multidimensional array functionality, it would be nice to provide some sort of
tensor.toArray<float[,,,]>()
functionality.And in general it would be nice to have a cheat-sheet of what was omitted relative to PyTorch and what the alternatives are.
Beta Was this translation helpful? Give feedback.
All reactions