Skip to content

Add random_state class #1139

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 25 commits into from
Nov 8, 2022
Merged

Conversation

LukichevaPolina
Copy link
Contributor

@LukichevaPolina LukichevaPolina commented Mar 2, 2022

  • Added RandomState class
  • Added RandomState.uniform() method
  • New tests implemented to cover both RandomState() and uniform() calls

Copy link
Contributor

@densmirn densmirn left a comment

Choose a reason for hiding this comment

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

Looks like we need to support the following use case:

rs = dpnp.random.RandomState(seed=1, sycl_queue=dpctl.SyclQueue())
rs.uniform(lower=0., upper=1, size=10, usm_type='device')

Perhaps we also need to provide parameter device for RandomState.
@Alexander-Makaryev what do you think about extra parameter?

@LukichevaPolina LukichevaPolina requested a review from densmirn March 9, 2022 07:54


seed = 1
default_random_state = RandomState(seed)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename it to dpnp_random_state if patched the PR.

@Alexander-Makaryev
Copy link
Contributor

Building in CI is failed.

@antonwolfy antonwolfy requested review from oleksandr-pavlyk and removed request for Alexander-Makaryev and KsanaKozlova August 12, 2022 06:20
@antonwolfy antonwolfy force-pushed the random_cfd branch 4 times, most recently from 252fd94 to f7bc0b3 Compare November 3, 2022 16:49
@antonwolfy antonwolfy force-pushed the random_cfd branch 2 times, most recently from 77d1c87 to 84d224d Compare November 7, 2022 19:35
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 think this is big improvement over previous state.

Existing minor issues will be addressed in subsequent RPs.

Thanks @antonwolfy for finishing this work.

@antonwolfy antonwolfy merged commit ebe4f2a into IntelPython:master Nov 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.

5 participants