From 1a67442fa29012c90c7981de7962fe47ccb6672c Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 27 Sep 2021 10:04:20 -0700 Subject: [PATCH 1/2] Update guidance on full-like dtype inferrence --- spec/API_specification/creation_functions.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/API_specification/creation_functions.md b/spec/API_specification/creation_functions.md index 7b22063da..dfd4a77a1 100644 --- a/spec/API_specification/creation_functions.md +++ b/spec/API_specification/creation_functions.md @@ -239,10 +239,14 @@ Returns a new array filled with `fill_value` and having the same `shape` as an i - **dtype**: _Optional\[ <dtype> ]_ - - 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`. + - output array data type. If `dtype` is `None`, the output array data type must be inferred from `x`. 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. + If `dtype` is `None` and the `fill_value` exceeds the precision of the resolved output array data type, behavior is unspecified and, thus, implementation-defined. + ``` + + ```{note} + If `dtype` is `None` and the `fill_value` has a data type (`int` or `float`) which does not participate in type promotion with the resolved output array data type (see {ref}`type-promotion`), behavior is unspecified and, thus, implementation-defined. ``` - **device**: _Optional\[ <device> ]_ From 9794aac11329b23ceec44e9fb6a3394bd58f24e9 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 27 Sep 2021 10:11:45 -0700 Subject: [PATCH 2/2] Update copy --- spec/API_specification/creation_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/creation_functions.md b/spec/API_specification/creation_functions.md index dfd4a77a1..89fb56b06 100644 --- a/spec/API_specification/creation_functions.md +++ b/spec/API_specification/creation_functions.md @@ -246,7 +246,7 @@ Returns a new array filled with `fill_value` and having the same `shape` as an i ``` ```{note} - If `dtype` is `None` and the `fill_value` has a data type (`int` or `float`) which does not participate in type promotion with the resolved output array data type (see {ref}`type-promotion`), behavior is unspecified and, thus, implementation-defined. + If `dtype` is `None` and the `fill_value` has a data type (`int` or `float`) which is not of the same data type kind as the resolved output array data type (see {ref}`type-promotion`), behavior is unspecified and, thus, implementation-defined. ``` - **device**: _Optional\[ <device> ]_