Skip to content

Conversation

@antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Feb 18, 2023

The list of missing aliases on numpy types are ported to dpnp:

  • cdouble
  • complex_
  • complexfloating
  • cfloat
  • csingle
  • double
  • float_
  • floating
  • inexact
  • int_
  • intc
  • number
  • object_
  • signedinteger
  • single
  • singlecomplex

The flowing type-related functions are added to dpnp:

  • issubdtype
  • issubsctype

The following constants are borrowed from numpy:

  • e
  • euler_gamma
  • Inf
  • inf
  • Infinity
  • infty
  • NAN
  • NaN
  • NINF
  • NZERO
  • pi
  • PINF
  • PZERO

This PR is intended to resolve issue #1307.

  • 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

@vlad-perevezentsev vlad-perevezentsev left a comment

Choose a reason for hiding this comment

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

LGTM!

@oleksandr-pavlyk
Copy link
Contributor

oleksandr-pavlyk commented Feb 27, 2023

I would suggest to remove dpnp.object_ since dpnp does not support this data type.

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.

I do not understand why we export and dpnp.longcomplex (a.k.a np.complex256) as we do not export dpnp.longdouble (a.k.a. np.float128) and we do not support this data type.

We also do no support np.void, so I suggest we remove dpnp.void too.

@antonwolfy
Copy link
Contributor Author

I do not understand why we export and dpnp.longcomplex (a.k.a np.complex256) as we do not export dpnp.longdouble (a.k.a. np.float128) and we do not support this data type.

We also do no support np.void, so I suggest we remove dpnp.void too.

Ok, agree.
What do you think to add constants like dpnp.pi, dpnp.inf and other ones from numpy? (they are also available in cupy as I can see)

@oleksandr-pavlyk
Copy link
Contributor

pi, e, nan, inf, newaxis are mandated by array API.

@antonwolfy
Copy link
Contributor Author

All numpy constants ara added to dpnp.

@antonwolfy antonwolfy merged commit 1897cf4 into IntelPython:master Mar 3, 2023
@antonwolfy antonwolfy deleted the add_type_aliases branch March 3, 2023 11:36
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