Skip to content

FULL add kernel #558

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 5 commits into from
Feb 5, 2021
Merged

FULL add kernel #558

merged 5 commits into from
Feb 5, 2021

Conversation

densmirn
Copy link
Contributor

@densmirn densmirn commented Feb 1, 2021

No description provided.

@densmirn densmirn requested a review from shssf February 1, 2021 14:34
@Alexander-Makaryev
Copy link
Contributor

I think that there is a more common solution for functions like full in my PR #536

@densmirn
Copy link
Contributor Author

densmirn commented Feb 1, 2021

I think that there is a more common solution for functions like full in my PR #536

Almost, except that full copies a scalar from one-element input array to resulting array instead of element-wise copying.

@@ -84,6 +85,28 @@ cpdef dparray dpnp_diag(v, k):
return result


cpdef dparray dpnp_full(result_shape, value_in, result_dtype):
""" Convert string type names (dparray.dtype) to C enum DPNPFuncType """

Choose a reason for hiding this comment

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

Suggested change
""" Convert string type names (dparray.dtype) to C enum DPNPFuncType """
# Convert string type names (dparray.dtype) to C enum DPNPFuncType

Please use comment sign for comments otherwise Cython converts this to strings from src.


_dtype = dtype if dtype is not None else type(fill_value)
if not use_origin_backend():
if order != 'C':

Choose a reason for hiding this comment

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

Suggested change
if order != 'C':
if order is not 'C':

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generally strings in Python are compared by value, not identity. I have one example which shows a potential issue:

a = 'hi'
b = ''.join(['h', 'i'])
a == b  # True
a is b  # False

Copy link

@samir-nasibli samir-nasibli left a comment

Choose a reason for hiding this comment

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

@densmirn in this PR you also moving some functional code (without changing) from one src to another, for future please do this kind of refactoring on separate PRs. PR must have one logic.

Copy link
Contributor

@Alexander-Makaryev Alexander-Makaryev left a comment

Choose a reason for hiding this comment

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

👍

@shssf shssf merged commit c366fb7 into IntelPython:master Feb 5, 2021
@densmirn densmirn deleted the perf/full branch September 20, 2021 11:35
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.

4 participants