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

[Numpy] np.clip does not support scalar #17787

Closed
xidulu opened this issue Mar 8, 2020 · 0 comments · Fixed by #17788
Closed

[Numpy] np.clip does not support scalar #17787

xidulu opened this issue Mar 8, 2020 · 0 comments · Fixed by #17788
Labels

Comments

@xidulu
Copy link
Contributor

xidulu commented Mar 8, 2020

As title

>>> from mxnet import np, npx
>>> npx.set_np()
>>> np.clip(0.5, 0.1,1.0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/mxnet_master_develop/python/mxnet/numpy/multiarray.py", line 6190, in clip
    return _mx_nd_np.clip(a, a_min, a_max, out=out)
  File "/home/ubuntu/mxnet_master_develop/python/mxnet/ndarray/numpy/_op.py", line 4358, in clip
    return _npi.clip(a, a_min, a_max, out=out)
  File "<string>", line 46, in clip
AssertionError: Argument data must have NDArray type, but got 0.5
>>> import numpy as onp
>>> onp.clip(0.5, 0.1, 1.0)
0.5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant