Skip to content

Conversation

@vlad-perevezentsev
Copy link
Collaborator

This PR adds dpctl.tensor.isdtype function according to Python array API standard .
This function takes a data type object and either a data type object, a string with the name of the kind of type(e.g. 'bool', 'real floating', 'numeric') or a tuple of strings or data types, and returns a boolean value indicating whether the input dtype is of a specified or is equal to the specified data type.

The PR solves #1119

  • 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?
  • If this PR is a work in progress, are you filing the PR as a draft?

@coveralls
Copy link
Collaborator

coveralls commented Mar 20, 2023

Coverage Status

Coverage: 82.846% (+0.06%) from 82.788% when pulling 36233fd on vlad-perevezentsev:add_dpctl.tensor.isdtype into 1a6bba0 on IntelPython:master.


@pytest.mark.parametrize("dtype_str", list_dtypes)
def test_isdtype_kind_tuple(dtype_str):
if dtype_str.startswith("bool"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar here, save dpt.dtype(dtype_str) and reuse it.

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.

This looks good to me! Thank you @vlad-perevezentsev

@oleksandr-pavlyk oleksandr-pavlyk merged commit 18bb612 into IntelPython:master Mar 22, 2023
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_18 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

@vlad-perevezentsev vlad-perevezentsev deleted the add_dpctl.tensor.isdtype branch June 20, 2023 10:53
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