SciSharp / NumSharp

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

Error when loading a `.npy` file containing a scalar value #517

Open thalesfm opened 2 months ago

thalesfm commented 2 months ago

Due to an off-by-one error, np.load fails to parse the file's header when shape = () and triggers an ArgumentOutOfRangeException (Also, the function doesn't consider this possibility when calculating the size of the underlying buffer).