@@ -116,50 +116,61 @@ def set_print_options(
116
116
Set options for printing :class:`dpctl.tensor.usm_ndarray` class.
117
117
118
118
Args:
119
- linewidth (int, optional): Number of characters printed per line.
119
+ linewidth (int, optional):
120
+ Number of characters printed per line.
120
121
Raises `TypeError` if linewidth is not an integer.
121
122
Default: `75`.
122
- edgeitems (int, optional): Number of elements at the beginning and end
123
+ edgeitems (int, optional):
124
+ Number of elements at the beginning and end
123
125
when the printed array is abbreviated.
124
126
Raises `TypeError` if edgeitems is not an integer.
125
127
Default: `3`.
126
- threshold (int, optional): Number of elements that triggers array
127
- abbreviation.
128
+ threshold (int, optional):
129
+ Number of elements that triggers array abbreviation.
128
130
Raises `TypeError` if threshold is not an integer.
129
131
Default: `1000`.
130
- precision (int or None, optional): Number of digits printed for
131
- floating point numbers.
132
+ precision (int or None, optional):
133
+ Number of digits printed for floating point numbers.
132
134
Raises `TypeError` if precision is not an integer.
133
135
Default: `8`.
134
- floatmode (str, optional): Controls how floating point
135
- numbers are interpreted.
136
-
137
- `"fixed:`: Always prints exactly `precision` digits.
138
- `"unique"`: Ignores precision, prints the number of
139
- digits necessary to uniquely specify each number.
140
- `"maxprec"`: Prints `precision` digits or fewer,
141
- if fewer will uniquely represent a number.
142
- `"maxprec_equal"`: Prints an equal number of digits
143
- for each number. This number is `precision` digits or fewer,
144
- if fewer will uniquely represent each number.
136
+ floatmode (str, optional):
137
+ Controls how floating point numbers are interpreted.
138
+ `"fixed:`:
139
+ Always prints exactly `precision` digits.
140
+ `"unique"`:
141
+ Ignores precision, prints the number of
142
+ digits necessary to uniquely specify each number.
143
+ `"maxprec"`:
144
+ Prints `precision` digits or fewer,
145
+ if fewer will uniquely represent a number.
146
+ `"maxprec_equal"`:
147
+ Prints an equal number of digits
148
+ for each number. This number is `precision` digits
149
+ or fewer, if fewer will uniquely represent each number.
145
150
Raises `ValueError` if floatmode is not one of
146
151
`fixed`, `unique`, `maxprec`, or `maxprec_equal`.
147
152
Default: "maxprec_equal"
148
- suppress (bool, optional): If `True,` numbers equal to zero
149
- in the current precision will print as zero.
153
+ suppress (bool, optional):
154
+ If `True,` numbers equal to zero in the current precision
155
+ will print as zero.
150
156
Default: `False`.
151
- nanstr (str, optional): String used to represent nan.
157
+ nanstr (str, optional):
158
+ String used to represent nan.
152
159
Raises `TypeError` if nanstr is not a string.
153
160
Default: `"nan"`.
154
- infstr (str, optional): String used to represent infinity.
161
+ infstr (str, optional):
162
+ String used to represent infinity.
155
163
Raises `TypeError` if infstr is not a string.
156
164
Default: `"inf"`.
157
- sign (str, optional): Controls the sign of floating point
158
- numbers.
159
- `"-"`: Omit the sign of positive numbers.
160
- `"+"`: Always print the sign of positive numbers.
161
- `" "`: Always print a whitespace in place of the
162
- sign of positive numbers.
165
+ sign (str, optional):
166
+ Controls the sign of floating point numbers.
167
+ `"-"`:
168
+ Omit the sign of positive numbers.
169
+ `"+"`:
170
+ Always print the sign of positive numbers.
171
+ `" "`:
172
+ Always print a whitespace in place of the
173
+ sign of positive numbers.
163
174
Raises `ValueError` if sign is not one of
164
175
`"-"`, `"+"`, or `" "`.
165
176
Default: `"-"`.
@@ -287,60 +298,71 @@ def usm_ndarray_str(
287
298
:class:`dpctl.tensor.usm_ndarray`.
288
299
289
300
Args:
290
- x (usm_ndarray): Input array.
291
- line_width (int, optional): Number of characters printed per line.
301
+ x (usm_ndarray):
302
+ Input array.
303
+ line_width (int, optional):
304
+ Number of characters printed per line.
292
305
Raises `TypeError` if line_width is not an integer.
293
306
Default: `75`.
294
- edgeitems (int, optional): Number of elements at the beginning and end
307
+ edgeitems (int, optional):
308
+ Number of elements at the beginning and end
295
309
when the printed array is abbreviated.
296
310
Raises `TypeError` if edgeitems is not an integer.
297
311
Default: `3`.
298
- threshold (int, optional): Number of elements that triggers array
299
- abbreviation.
312
+ threshold (int, optional):
313
+ Number of elements that triggers array abbreviation.
300
314
Raises `TypeError` if threshold is not an integer.
301
315
Default: `1000`.
302
- precision (int or None, optional): Number of digits printed for
303
- floating point numbers.
316
+ precision (int or None, optional):
317
+ Number of digits printed for floating point numbers.
304
318
Raises `TypeError` if precision is not an integer.
305
319
Default: `8`.
306
- floatmode (str, optional): Controls how floating point
307
- numbers are interpreted.
308
-
309
- `"fixed:`: Always prints exactly `precision` digits.
310
- `"unique"`: Ignores precision, prints the number of
311
- digits necessary to uniquely specify each number.
312
- `"maxprec"`: Prints `precision` digits or fewer,
313
- if fewer will uniquely represent a number.
314
- `"maxprec_equal"`: Prints an equal number of digits
315
- for each number. This number is `precision` digits or fewer,
316
- if fewer will uniquely represent each number.
320
+ floatmode (str, optional):
321
+ Controls how floating point numbers are interpreted.
322
+ `"fixed:`:
323
+ Always prints exactly `precision` digits.
324
+ `"unique"`:
325
+ Ignores precision, prints the number of
326
+ digits necessary to uniquely specify each number.
327
+ `"maxprec"`:
328
+ Prints `precision` digits or fewer,
329
+ if fewer will uniquely represent a number.
330
+ `"maxprec_equal"`:
331
+ Prints an equal number of digits for each number.
332
+ This number is `precision` digits or fewer,
333
+ if fewer will uniquely represent each number.
317
334
Raises `ValueError` if floatmode is not one of
318
335
`fixed`, `unique`, `maxprec`, or `maxprec_equal`.
319
336
Default: "maxprec_equal"
320
- suppress (bool, optional): If `True,` numbers equal to zero
321
- in the current precision will print as zero.
337
+ suppress (bool, optional):
338
+ If `True,` numbers equal to zero in the current precision
339
+ will print as zero.
322
340
Default: `False`.
323
- sign (str, optional): Controls the sign of floating point
324
- numbers.
325
- `"-"`: Omit the sign of positive numbers.
326
- `"+"`: Always print the sign of positive numbers.
327
- `" "`: Always print a whitespace in place of the
328
- sign of positive numbers.
341
+ sign (str, optional):
342
+ Controls the sign of floating point numbers.
343
+ `"-"`:
344
+ Omit the sign of positive numbers.
345
+ `"+"`:
346
+ Always print the sign of positive numbers.
347
+ `" "`:
348
+ Always print a whitespace in place of the
349
+ sign of positive numbers.
329
350
Raises `ValueError` if sign is not one of
330
351
`"-"`, `"+"`, or `" "`.
331
352
Default: `"-"`.
332
- numpy (bool, optional): If `True,` then before other specified print
353
+ numpy (bool, optional):
354
+ If `True,` then before other specified print
333
355
options are set, a dictionary of Numpy's print options
334
356
will be used to initialize dpctl's print options.
335
357
Default: "False"
336
- separator (str, optional): String inserted between elements of
337
- the array string.
358
+ separator (str, optional):
359
+ String inserted between elements of the array string.
338
360
Default: " "
339
- prefix (str, optional): String used to determine spacing to the left
340
- of the array string.
361
+ prefix (str, optional):
362
+ String used to determine spacing to the left of the array string.
341
363
Default: ""
342
- suffix (str, optional): String that determines length of the last line
343
- of the array string.
364
+ suffix (str, optional):
365
+ String that determines length of the last line of the array string.
344
366
Default: ""
345
367
346
368
Returns:
0 commit comments