Skip to content

Use full() function from dpctl.tensor #1218

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

Merged
merged 13 commits into from
Dec 9, 2022
Merged

Conversation

npolina4
Copy link
Contributor

@npolina4 npolina4 commented Nov 2, 2022

Use full() function from dpctl.tensor module instead of DPNP backend implementation.
A cython code relating to full() call is cleaned up.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • If this PR is a work in progress, are you filing the PR as a draft?

Copy link
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it would be great to extend test_array_creation() test in tests/test_sycl_queue.py and to add new test_full() in tests/test_arraycreation.py covering basic functionality and corner cases.

The following tests needs to be excluded from ignore list, i.e. to be removed from tests/skipped_tests_gpu.tbl file:

tests/third_party/cupy/creation_tests/test_basic.py::TestBasic::test_full
tests/third_party/cupy/creation_tests/test_basic.py::TestBasic::test_full_default_dtype
tests/third_party/cupy/creation_tests/test_basic.py::TestBasic::test_full_default_dtype_cpu_input

if isinstance(fill_value, dpnp_array):
fill_value = fill_value.get_array()

"""Creates `dpnp_array` where every element is equal to fill_value."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docstring is blatantly wrong when fill_value is an array. NumPy says "Return a new array of given shape and type, filled with fill_value."

Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It would be nice to try numba_dpex with this change in dpnp to verify that dpnp.full stays properly supported in JIT-ted functions.

@oleksandr-pavlyk oleksandr-pavlyk merged commit e5b088c into master Dec 9, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the use_dpctl_full branch December 9, 2022 20:52
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

Successfully merging this pull request may close these issues.

3 participants