-
Notifications
You must be signed in to change notification settings - Fork 15
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
np.load, np.save missing #48
Comments
I think I looked at np.load and np.save before. It is a very big task to implement these and I didn't have time to do it. Nobody has asked for them in 5 years so they are not the most commonly used functions. In python/numpy there is a very significant performance improvement by saving/loading the arrays with those functions because they are written in C and not python. My view is that an application user of numpydotnet should probably write their own specific load/save functions. Since it would be in .NET either way, there is no performance to be gained by replicating these functions in the library. Can you implement your own load and save functions? FYI, we do support np.tofile and np.fromfile If you really need to be 100% compatible with the python file format, let me know. Also, we recently added support for serializing ndarrays. See ndarray.ToSerializable(). It will return a class object that can be serialized to a string and written to a disk file. |
I think it is not necessary to add |
@KevinBaselinesw I noticed that you are working on PS: the current Finally, I REALLY appreciate your works, I explored many multi-dimensional array libraries for C#, such as NumSharp, Numpy.NET, Tensor.NET from SciSharp, thanks for their efforts, but they are not convenient and complete as this work, TorchSharp is great but I don't want to install such a huge library just for multi-dimension array calculation. Thanks for your work again!!! 😄 |
@rainyl I have tried to port np.load() but it is very complicated and too much work. I recommend that people use the newly added .ToSerializable() method. This is probably a more modern way to save, share and restore data structures in a .NET application. The serializable data structures can then be converted to json or XML for writing to a file, database or network API. But of course it is not binary compatible with the python output of np.save() and np.load()
|
Yes, you are right, for saving files, |
Could you evaluate if these codes are useful "Starting Ideas" to address the missing np.load and np.save functions https://github.com/SciSharp/NumSharp/blob/master/src/NumSharp.Core/APIs/np.load.cs Less relevant, but FYI |
I've been working on implementing |
submit the PR, it will be useful for the community, especially those from the Scisharp |
sorry I was out of town for a few days. Feel free to create a PR (with some unit tests please). I will review it and potentially accept it. |
Is it possible to add these two functions to load and save npy file?
Thanks!
The text was updated successfully, but these errors were encountered: