Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

np.log: ValueError 'Too many positional arguments' for scalar inputs #134

Open
wellecks opened this issue Jan 23, 2017 · 1 comment
Open

Comments

@wellecks
Copy link
Member

Hi, please see the script below; log throws an error when a scalar is provided as input (this may also occur for other operations like abs). Using a singleton array works as a workaround, but I wanted to check whether the error is desired behavior?

import minpy.numpy as mp
import numpy as np

# works
np.log(2)

# works
mp.log(mp.array([2]))

# ValueError
mp.log(2)
@ZihengJiang
Copy link
Member

Sorry, this problem is caused by the difference between MXNet API and NumPy API, as you can see, in MXNet, the code below cannot work well too:

import mxnet.ndarray as nd

# works
nd.log(nd.array([2]))

# error
nd.log(2)

This problem should be fixed in the near future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants