NumSharp icon indicating copy to clipboard operation
NumSharp copied to clipboard

np.negative is not working ?

Open LordTrololo opened this issue 5 years ago • 0 comments

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);

LordTrololo avatar Apr 21 '20 07:04 LordTrololo