Skip to content

Conversation

@oleksandr-pavlyk
Copy link
Contributor

This PR implements dpctl.tensor.linspace as per array-API specification.

In [1]: import dpctl.tensor as dpt

In [2]: dpt.asnumpy(dpt.linspace(0, 3 + 3j, num=4))
Out[2]: array([0.+0.j, 1.+1.j, 2.+2.j, 3.+3.j])

In [3]: dpt.asnumpy(dpt.linspace(0, 3 + 3j, num=5, endpoint=False))
Out[3]: array([0. +0.j , 0.6+0.6j, 1.2+1.2j, 1.8+1.8j, 2.4+2.4j])

In [4]: dpt.asnumpy(dpt.linspace(0, 3 + 3j, num=3, endpoint=False))
Out[4]: array([0.+0.j, 1.+1.j, 2.+2.j])

In [5]: dpt.asnumpy(dpt.linspace(0, 3, num=3, endpoint=False))
Out[5]: array([0., 1., 2.])
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an 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?

@github-actions
Copy link

github-actions bot commented Aug 6, 2022

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.04%) to 81.859% when pulling 01b6cc1 on add-linspace into da1bf68 on master.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 92d2e05 into master Aug 6, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the add-linspace branch August 6, 2022 03:17
@github-actions
Copy link

github-actions bot commented Aug 6, 2022

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

oleksandr-pavlyk added a commit that referenced this pull request Aug 6, 2022
ndgrigorian pushed a commit to ndgrigorian/dpctl that referenced this pull request Sep 8, 2022
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.

2 participants