Skip to content

Commit 7499649

Browse files
authored
Add a note clarifying edge case (#261)
1 parent 5e33e0d commit 7499649

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec/API_specification/creation_functions.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ Returns a new array having a specified `shape` and filled with `fill_value`.
206206
207207
- **dtype**: _Optional\[ <dtype> ]_
208208
209-
- output array data type. If `dtype` is `None`, the output array data type must be inferred from `fill_value`. If it's an `int`, the output array dtype must be the default integer dtype; if it's a `float`, then the output array dtype must be the default floating-point data type; if it's a `bool` then the output array must have boolean dtype. Default: `None`.
209+
- output array data type. If `dtype` is `None`, the output array data type must be inferred from `fill_value`. If the fill value is an `int`, the output array data type must be the default integer data type. If the fill value is a `float`, the output array data type must be the default floating-point data type. If the fill value is a `bool`, the output array must have boolean data type. Default: `None`.
210+
211+
```{note}
212+
If `dtype` is `None` and the `fill_value` exceeds the precision of the resolved default output array data type, behavior is left unspecified and, thus, implementation-defined.
213+
```
210214
211215
- **device**: _Optional\[ <device> ]_
212216
@@ -237,6 +241,10 @@ Returns a new array filled with `fill_value` and having the same `shape` as an i
237241
238242
- output array data type. If `dtype` is `None`, the output array data type must be inferred from `fill_value` (see {ref}`function-full`). Default: `None`.
239243
244+
```{note}
245+
If `dtype` is `None` and the `fill_value` exceeds the precision of the resolved default output array data type, behavior is left unspecified and, thus, implementation-defined.
246+
```
247+
240248
- **device**: _Optional\[ <device> ]_
241249
242250
- device to place the created array on, if given. If `device` is `None`, the default device must be used, not `x.device`. Default: `None`.

0 commit comments

Comments
 (0)