NumSharp icon indicating copy to clipboard operation
NumSharp copied to clipboard

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

Open lijianxin520 opened this issue 4 years ago • 13 comments

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

lijianxin520 avatar Apr 13 '21 06:04 lijianxin520

What datatype are you trying to use?

Nucs avatar Apr 13 '21 11:04 Nucs

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

lijianxin520 avatar Apr 14 '21 00:04 lijianxin520

image

lijianxin520 avatar Apr 14 '21 01:04 lijianxin520

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.

Nucs avatar Apr 14 '21 11:04 Nucs

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

lijianxin520 avatar Apr 15 '21 01:04 lijianxin520

same problem. Is there a walkaround for now?

bigdimboom avatar Apr 18 '21 17:04 bigdimboom

@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.

Nucs avatar Apr 21 '21 04:04 Nucs

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

ppsdatta avatar Apr 23 '21 10:04 ppsdatta

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

badjano avatar Aug 19 '21 22:08 badjano

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

gv-collibris avatar Aug 25 '21 13:08 gv-collibris

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.

yuta0306 avatar Nov 10 '21 00:11 yuta0306

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

guozifeng91 avatar Jan 10 '24 17:01 guozifeng91

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

PavanSuta avatar Feb 26 '24 22:02 PavanSuta