Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Numpy Operator Inconsistency #16357

Closed
stu1130 opened this issue Oct 2, 2019 · 8 comments
Closed

Numpy Operator Inconsistency #16357

stu1130 opened this issue Oct 2, 2019 · 8 comments

Comments

@stu1130
Copy link
Contributor

stu1130 commented Oct 2, 2019

argmax

The dtype return be argmax is float32 instead of int

>>> d = mx.np.array([0, 1])
>>> mx.np.argmax(d)
array(1.)
>>> mx.np.argmax(d).dtype
<class 'numpy.float32'>

repeat

import mxnet as mx
from mxnet import util


@util.use_np
def func():
    x = mx.np.array([[1,2],[3,4]])
    print(mx.np.repeat(x, [1, 2], axis=0))

func()
mxnet.base.MXNetError: Invalid Parameter format for repeats expect int but value='[1, 2]', in operator repeat(name="", axis="0", repeats="[1, 2]")

softmax

import mxnet as mx
from mxnet import util

@util.use_np
def func():
    x = mx.np.array([], ctx=mx.gpu(0)).reshape(2, 0, 0)
    print(mx.npx.softmax(x))

func()
Floating point exception (core dumped)

mean

import mxnet as mx
from mxnet import util


@util.use_np
def func():
    x = mx.np.array([], ctx=mx.gpu(0)).reshape(2, 0, 0)
    print(mx.np.mean(x))
func()
0.0 (expect NaN)

prod

import mxnet as mx
from mxnet import util


@util.use_np
def func():
    x = mx.np.array([], ctx=mx.gpu(0)).reshape(2, 0, 0)
    print(mx.np.prod(x))
func()
0.0 (expect 1.0)
@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended label(s): Bug

@stu1130
Copy link
Contributor Author

stu1130 commented Oct 2, 2019

@mxnet-label-bot add [Numpy]

@stu1130 stu1130 changed the title Numpy Transpose Operator Inconsistency Numpy Operator Inconsistency Oct 2, 2019
@reminisce reminisce added the Bug label Oct 2, 2019
@sxjscience
Copy link
Member

duplicate: #16048

@samskalicky
Copy link
Contributor

@zachgk assign [@reminisce ]

@reminisce
Copy link
Contributor

transpose fixed in #16414.

@haojin2
Copy link
Contributor

haojin2 commented Nov 19, 2019

Issues with np.transpose and np.split are fixed, removing those parts from the issue.

@yzhliu yzhliu added the v2.0 label Apr 29, 2020
@yzhliu yzhliu added the WIP label May 7, 2020
@yzhliu
Copy link
Member

yzhliu commented May 7, 2020

@Yiyan66 is looking into it.

@yzhliu
Copy link
Member

yzhliu commented Jun 9, 2020

closed by #18286 #18371

@yzhliu yzhliu closed this as completed Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants