minpy
minpy copied to clipboard
np.log: ValueError 'Too many positional arguments' for scalar inputs
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)
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.