Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] numpy.full has keyword arg "fill_value" #1144

Open
suranap opened this issue Jul 24, 2024 · 1 comment
Open

[BUG] numpy.full has keyword arg "fill_value" #1144

suranap opened this issue Jul 24, 2024 · 1 comment

Comments

@suranap
Copy link

suranap commented Jul 24, 2024

value: Any,

change to fill_value. See doc.

@suranap suranap changed the title numpy.full has keyword arg "fill_value" [BUG] numpy.full has keyword arg "fill_value" Jul 25, 2024
@suranap
Copy link
Author

suranap commented Aug 2, 2024

Also, fill_value supports array_like, but cunumeric only supports scalar.

cnp is cunumeric

>>> np.full(shape=(5,2), fill_value=(4,5))
array([[4, 5],
       [4, 5],
       [4, 5],
       [4, 5],
       [4, 5]])
>>> cnp.full(shape=(5,2), fill_value=(4,5))
TypeError: only length-1 arrays can be converted to Python scalars

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/suranap/projects/legate/legate.core/legate/core/runtime.py", line 2154, in wrapper
    result = func(*args, **kwargs)
  File "/home/suranap/projects/legate/cunumeric/cunumeric/coverage.py", line 120, in wrapper
    return func(*args, **kwargs)
  File "/home/suranap/projects/legate/cunumeric/cunumeric/module.py", line 420, in full
    result._thunk.fill(val)
  File "/home/suranap/projects/legate/cunumeric/cunumeric/eager.py", line 536, in fill
    self.array.fill(value)
ValueError: setting an array element with a sequence.

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

No branches or pull requests

1 participant