SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.34k stars 188 forks source link

np.save incorrectly saves System.Byte arrays as signed #461

Open rikkitook opened 2 years ago

rikkitook commented 2 years ago

in function GetDtypeFromType ... if (type == typeof(Byte)) return "|i1"; ... i1 gets translated to signed integer https://numpy.org/doc/stable/user/basics.types.html

Cle-O commented 1 year ago

Bump. This issue is still existing. I am saving a numpy array (an image) with positive values only using np.save(). Positive values only are verified calling amin() on the array. After reading the file again, the array contains negative values. Is there a workaround for this?