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

np.sum() Is supported on numsharp0.20.5, but not on NumSharp0.30.0 #447

Open lijianxin520 opened 3 years ago

lijianxin520 commented 3 years ago

np.sum() Is supported on numsharp0.20.5, but not on NumSharp0.30.0 the exception message :"Specified method is not supported."

Nucs commented 3 years ago

What datatype are you trying to use?

lijianxin520 commented 3 years ago

double s = np.sum(w * w); w data type is NDArray;

lijianxin520 commented 3 years ago

image

Nucs commented 3 years ago

I mean what will this output on NumSharp 20.5?

Console.WriteLine(w.dtype);
Console.WriteLine(s.dtype);

At version 30.x+ @Oceania2018 has removed many supported DTypes which might cause NotSupportedException or NotImplementedException. Some even return null.

lijianxin520 commented 3 years ago

Thank you very much for your attention, the following is the supplementary content. image

bigdimboom commented 3 years ago

same problem. Is there a walkaround for now?

Nucs commented 3 years ago

@lijianxin520 I was not able to reproduce this locally, can you or @bigdimboom provide with a simple unit test that reproduces this and I'll take a deeper look.

ppsdatta commented 3 years ago

Hello, I encountered this problem as well and here's some data to help investigate:

  1. A sample code which reproduces the problem on my Mac - Visual Studio. https://github.com/ppsdatta/NpSumIssue
  2. With version 0.30.0 the code fails with the not supported error. Error screen shot
  3. With version 0.20.5 the code works without runtime exception. No error screen shot
badjano commented 3 years ago

having exact same error, numsharp 0.30.0 any workaround besides you know... for?

gv-collibris commented 3 years ago

same error with NumSharp 0.30.0, with np.sum(NDArray[])

yuta0306 commented 3 years ago

I also encountered the same error. When the value of elements of NDArray is double, this error certainly occur. To change the type double to float works well in my case.

guozifeng91 commented 10 months ago

same error here, sum() works for int but not for double, using version 0.30.0

PavanSuta commented 9 months ago

I am using v4.0.30319 Numsharp. Getting the same error after calling the sum function. I am passing NDArray Double datatype.