From a62f9234f26dac531bc11c5400f5808161deec8b Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 13 Sep 2021 03:00:47 -0700 Subject: [PATCH] Add a note clarifying edge case --- spec/API_specification/creation_functions.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/API_specification/creation_functions.md b/spec/API_specification/creation_functions.md index da7b250b4..b482c6d06 100644 --- a/spec/API_specification/creation_functions.md +++ b/spec/API_specification/creation_functions.md @@ -206,7 +206,11 @@ Returns a new array having a specified `shape` and filled with `fill_value`. - **dtype**: _Optional\[ <dtype> ]_ - - 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`. + - 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`. + + ```{note} + 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. + ``` - **device**: _Optional\[ <device> ]_ @@ -237,6 +241,10 @@ Returns a new array filled with `fill_value` and having the same `shape` as an i - 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`. + ```{note} + 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. + ``` + - **device**: _Optional\[ <device> ]_ - device to place the created array on, if given. If `device` is `None`, the default device must be used, not `x.device`. Default: `None`.