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

Extend linspace kernel to allow floating point parameters even for integer destination type #1056

Open
oleksandr-pavlyk opened this issue Feb 2, 2023 · 0 comments

Comments

@oleksandr-pavlyk
Copy link
Collaborator

oleksandr-pavlyk commented Feb 2, 2023

The #1051 modified behavior of linspace outside of scope of array-API spec (presumable less common/useful combination of parameters). It is an improvement towards aligning with NumPy's behavior, but it only goes half-way (does not fix negative integers):

In [7]: np.linspace(-1.9,9.1, 13, endpoint=True, dtype=int)
Out[7]: array([-2, -1, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9])

In [8]: dpt.linspace(-1.9,9.1, 13, endpoint=True, dtype=int)
Out[8]: usm_ndarray([-1,  0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9])

I think we should change C++ kernel to handle this without additional copy, but this task is not an immediate priority, in my opinion. This note is to create a new issue to make sure this does become forgotten.

Originally posted by @oleksandr-pavlyk in #1051 (comment)

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