Skip to content

Commit 0c99ea2

Browse files
authored
Update device guidance for *_like functions (#268)
The default behavior is changed is infer the output array device from the input array when `device` is `None`.
1 parent 614f8c1 commit 0c99ea2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/API_specification/creation_functions.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Returns an uninitialized array with the same `shape` as an input array `x`.
127127

128128
- **device**: _Optional\[ <device> ]_
129129

130-
- device on which to place the created array. If `device` is `None`, the default device must be used, not `x.device`. Default: `None`.
130+
- device on which to place the created array. If `device` is `None`, the output array device must be inferred from `x`. Default: `None`.
131131

132132
#### Returns
133133

@@ -247,7 +247,7 @@ Returns a new array filled with `fill_value` and having the same `shape` as an i
247247
248248
- **device**: _Optional\[ <device> ]_
249249
250-
- device on which to place the created array. If `device` is `None`, the default device must be used, not `x.device`. Default: `None`.
250+
- device on which to place the created array. If `device` is `None`, the output array device must be inferred from `x`. Default: `None`.
251251
252252
#### Returns
253253
@@ -370,7 +370,7 @@ Returns a new array filled with ones and having the same `shape` as an input arr
370370
371371
- **device**: _Optional\[ <device> ]_
372372
373-
- device on which to place the created array. If `device` is `None`, the default device must be used, not `x.device`. Default: `None`.
373+
- device on which to place the created array. If `device` is `None`, the output array device must be inferred from `x`. Default: `None`.
374374
375375
#### Returns
376376
@@ -478,7 +478,7 @@ Returns a new array filled with zeros and having the same `shape` as an input ar
478478
479479
- **device**: _Optional\[ <device> ]_
480480
481-
- device on which to place the created array. If `device` is `None`, the default device must be used, not `x.device`. Default: `None`.
481+
- device on which to place the created array. If `device` is `None`, the output array device must be inferred from `x`. Default: `None`.
482482
483483
#### Returns
484484

0 commit comments

Comments
 (0)