SciSharp / NumSharp

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

np.negative is not working ? #407

Open LordTrololo opened 4 years ago

LordTrololo commented 4 years ago

Hi,

I have a NDArray of Floats with dimensions {(1, 13, 13, 3, 2)} and size 1014.

np.negative(myArray)

works by converting all values to negative. However I think that official Numpy behaviour is to convert positives to negatives and negatives to positives.

Like so:

np.negative([1.,-1.])
array([-1.,  1.])

What I get is:

np.negative([1.,-1.])
array([-1.,  -1.])

Did someone experience similar problem ?

BTW, the solution I use to solve the problem is trivial - var negativeArray = myarray*(-1);