@@ -57,6 +57,22 @@ class RandomState:
57
57
A container for the Mersenne Twister pseudo-random number generator.
58
58
59
59
For full documentation refer to :obj:`numpy.random.RandomState`.
60
+
61
+ Parameters
62
+ ----------
63
+ device : {None, string, SyclDevice, SyclQueue}, optional
64
+ An array API concept of device where the output array is created.
65
+ `device` can be ``None`` (the default), a oneAPI filter selector string,
66
+ an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device,
67
+ an instance of :class:`dpctl.SyclQueue`, or a `Device` object returned by
68
+ :obj:`dpnp.dpnp_array.dpnp_array.device` property.
69
+ sycl_queue : {None, SyclQueue}, optional
70
+ The SYCL queue to use for output array allocation and copying.
71
+
72
+ Limitations
73
+ -----------
74
+ Parameter `seed` is supported as either a integer scalar or array_like
75
+ of maximumum three integer scalars.
60
76
"""
61
77
62
78
def __init__ (self , seed = None , device = None , sycl_queue = None ):
@@ -107,9 +123,9 @@ def _is_signbit_scalar(self, x):
107
123
108
124
def _validate_float_dtype (self , dtype , supported_types ):
109
125
"""
110
- Test an input floating type if it is listed in `` supported_types` ` and
126
+ Test an input floating type if it is listed in `supported_types` and
111
127
if it is supported by the used SYCL device.
112
- If `` dtype`` is None, default floating type will be validating.
128
+ If `dtype` is `` None`` , default floating type will be validating.
113
129
Return the examined floating type if it follows all validation checks.
114
130
"""
115
131
@@ -139,7 +155,7 @@ def get_state(self):
139
155
140
156
def get_sycl_queue (self ):
141
157
"""
142
- Return an instance of of :class:`dpctl.SyclQueue` used within the generator for data allocation.
158
+ Return an instance of :class:`dpctl.SyclQueue` used within the generator for data allocation.
143
159
144
160
Returns
145
161
-------
@@ -151,7 +167,7 @@ def get_sycl_queue(self):
151
167
152
168
def get_sycl_device (self ):
153
169
"""
154
- Return an instance of of :class:`dpctl.SyclDevice` used within the generator to allocate data on.
170
+ Return an instance of :class:`dpctl.SyclDevice` used within the generator to allocate data on.
155
171
156
172
Returns
157
173
-------
@@ -169,21 +185,21 @@ def normal(self, loc=0.0, scale=1.0, size=None, dtype=None, usm_type="device"):
169
185
170
186
Parameters
171
187
----------
172
- usm_type : ( "device" | "shared" | "host") , optional
188
+ usm_type : { "device", "shared", "host"} , optional
173
189
The type of SYCL USM allocation for the output array.
174
190
175
191
Returns
176
192
-------
177
193
out : dpnp.ndarray
178
194
Drawn samples from the parameterized normal distribution.
179
- Output array data type is the same as input `` dtype`` . If `` dtype`` is None ( default),
180
- :obj:`dpnp.float64` type will be used if device supports it or :obj:`dpnp.float32` otherwise.
195
+ Output array data type is the same as input `dtype`. If `dtype` is `` None`` (the default),
196
+ :obj:`dpnp.float64` type will be used if device supports it, or :obj:`dpnp.float32` otherwise.
181
197
182
198
Limitations
183
199
-----------
184
- Parameters `` loc`` and `` scale` ` are supported as scalar. Otherwise,
200
+ Parameters `loc` and `scale` are supported as scalar. Otherwise,
185
201
:obj:`numpy.random.RandomState.normal(loc, scale, size)` samples are drawn.
186
- Parameter `` dtype`` is supported only for :obj:`dpnp.float32`, :obj:`dpnp.float64` or `None`.
202
+ Parameter `dtype` is supported only as :obj:`dpnp.float32`, :obj:`dpnp.float64` or `` None` `.
187
203
188
204
Examples
189
205
--------
@@ -241,14 +257,14 @@ def rand(self, *args, usm_type="device"):
241
257
242
258
Parameters
243
259
----------
244
- usm_type : ( "device" | "shared" | "host") , optional
260
+ usm_type : { "device", "shared", "host"} , optional
245
261
The type of SYCL USM allocation for the output array.
246
262
247
263
Returns
248
264
-------
249
265
out : dpnp.ndarray
250
266
Random values in a given shape.
251
- Output array data type is :obj:`dpnp.float64` if device supports it or :obj:`dpnp.float32` otherwise.
267
+ Output array data type is :obj:`dpnp.float64` if device supports it, or :obj:`dpnp.float32` otherwise.
252
268
253
269
Examples
254
270
--------
@@ -284,21 +300,21 @@ def randint(self, low, high=None, size=None, dtype=int, usm_type="device"):
284
300
285
301
Parameters
286
302
----------
287
- usm_type : ( "device" | "shared" | "host") , optional
303
+ usm_type : { "device", "shared", "host"} , optional
288
304
The type of SYCL USM allocation for the output array.
289
305
290
306
Returns
291
307
-------
292
308
out : dpnp.ndarray
293
309
`size`-shaped array of random integers from the appropriate distribution,
294
- or a single such random int if `size` not provided.
295
- Output array data type is the same as input `` dtype` `.
310
+ or a single such random int if `size` is not provided.
311
+ Output array data type is the same as input `dtype`.
296
312
297
313
Limitations
298
314
-----------
299
- Parameters `` low`` and `` high`` are supported only as scalar.
300
- Parameter `` dtype`` is supported only as :obj:`dpnp.int32` or `int`,
301
- but `int` value is considered to be exactly equivalent to :obj:`dpnp.int32`.
315
+ Parameters `low` and `high` are supported only as a scalar.
316
+ Parameter `dtype` is supported only as :obj:`dpnp.int32` or `` int` `,
317
+ but `` int` ` value is considered to be exactly equivalent to :obj:`dpnp.int32`.
302
318
Otherwise, :obj:`numpy.random.randint(low, high, size, dtype)` samples are drawn.
303
319
304
320
Examples
@@ -359,7 +375,7 @@ def randn(self, *args, usm_type="device"):
359
375
360
376
Parameters
361
377
----------
362
- usm_type : ( "device" | "shared" | "host") , optional
378
+ usm_type : { "device", "shared", "host"} , optional
363
379
The type of SYCL USM allocation for the output array.
364
380
365
381
Returns
@@ -368,7 +384,7 @@ def randn(self, *args, usm_type="device"):
368
384
A ``(d0, d1, ..., dn)``-shaped array of floating-point samples from
369
385
the standard normal distribution, or a single such float if
370
386
no parameters were supplied.
371
- Output array data type is :obj:`dpnp.float64` if device supports it
387
+ Output array data type is :obj:`dpnp.float64` if device supports it,
372
388
or :obj:`dpnp.float32` otherwise.
373
389
374
390
Examples
@@ -408,15 +424,15 @@ def random_sample(self, size=None, usm_type="device"):
408
424
409
425
Parameters
410
426
----------
411
- usm_type : ( "device" | "shared" | "host") , optional
427
+ usm_type : { "device", "shared", "host"} , optional
412
428
The type of SYCL USM allocation for the output array.
413
429
414
430
Returns
415
431
-------
416
432
out : dpnp.ndarray
417
433
Array of random floats of shape `size` (if ``size=None``,
418
434
zero dimension array with a single float is returned).
419
- Output array data type is :obj:`dpnp.float64` if device supports it
435
+ Output array data type is :obj:`dpnp.float64` if device supports it,
420
436
or :obj:`dpnp.float32` otherwise.
421
437
422
438
Examples
@@ -447,15 +463,15 @@ def standard_normal(self, size=None, usm_type="device"):
447
463
448
464
Parameters
449
465
----------
450
- usm_type : ( "device" | "shared" | "host") , optional
466
+ usm_type : { "device", "shared", "host"} , optional
451
467
The type of SYCL USM allocation for the output array.
452
468
453
469
Returns
454
470
-------
455
471
out : dpnp.ndarray
456
- A floating-point array of shape `` size` ` of drawn samples, or a
457
- single sample if `` size` ` was not specified.
458
- Output array data type is :obj:`dpnp.float64` if device supports it
472
+ A floating-point array of shape `size` of drawn samples, or a
473
+ single sample if `size` was not specified.
474
+ Output array data type is :obj:`dpnp.float64` if device supports it,
459
475
or :obj:`dpnp.float32` otherwise.
460
476
461
477
Examples
@@ -492,21 +508,21 @@ def uniform(self, low=0.0, high=1.0, size=None, dtype=None, usm_type="device"):
492
508
493
509
Parameters
494
510
----------
495
- usm_type : ( "device" | "shared" | "host") , optional
511
+ usm_type : { "device", "shared", "host"} , optional
496
512
The type of SYCL USM allocation for the output array.
497
513
498
514
Returns
499
515
-------
500
516
out : dpnp.ndarray
501
517
Drawn samples from the parameterized uniform distribution.
502
- Output array data type is the same as input `` dtype`` . If `` dtype`` is None ( default),
503
- :obj:`dpnp.float64` type will be used if device supports it or :obj:`dpnp.float32` otherwise.
518
+ Output array data type is the same as input `dtype`. If `dtype` is `` None`` (the default),
519
+ :obj:`dpnp.float64` type will be used if device supports it, or :obj:`dpnp.float32` otherwise.
504
520
505
521
Limitations
506
522
-----------
507
- Parameters `` low`` and `` high` ` are supported as scalar. Otherwise,
523
+ Parameters `low` and `high` are supported as scalar. Otherwise,
508
524
:obj:`numpy.random.uniform(low, high, size)` samples are drawn.
509
- Parameter `` dtype`` is supported only for :obj:`dpnp.int32`, :obj:`dpnp.float32`, :obj:`dpnp.float64` or `None`.
525
+ Parameter `dtype` is supported only as :obj:`dpnp.int32`, :obj:`dpnp.float32`, :obj:`dpnp.float64` or `` None` `.
510
526
511
527
Examples
512
528
--------
0 commit comments