You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add complex number support to full and full_like (#435)
* Add complex number support to `full` and `full_like`
* Use a list when enumerating rules
* Fix missing article
* Fix type annotations which omit `bool`
Returns a new array having a specified ``shape`` and filled with ``fill_value``.
161
161
162
162
Parameters
163
163
----------
164
164
shape: Union[int, Tuple[int, ...]]
165
165
output array shape.
166
-
fill_value: Union[int, float]
166
+
fill_value: Union[bool, int, float, complex]
167
167
fill value.
168
168
dtype: Optional[dtype]
169
-
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 real-valued floating-point data type. If the fill value is a ``bool``, the output array must have boolean data type. Default: ``None``.
169
+
output array data type. If ``dtype`` is ``None``, the output array data type must be inferred from ``fill_value`` according to the following rules:
170
+
171
+
- If the fill value is an ``int``, the output array data type must be the default integer data type.
172
+
- If the fill value is a ``float``, the output array data type must be the default real-valued floating-point data type.
173
+
- If the fill value is a ``complex`` number, the output array data type must be the default complex floating-point data type.
174
+
- If the fill value is a ``bool``, the output array must have a boolean data type. Default: ``None``.
170
175
171
176
.. note::
172
177
If the ``fill_value`` exceeds the precision of the resolved default output array data type, behavior is left unspecified and, thus, implementation-defined.
If the ``fill_value`` exceeds the precision of the resolved output array data type, behavior is unspecified and, thus, implementation-defined.
198
203
199
204
.. note::
200
-
If 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.
205
+
If the ``fill_value`` has a data type which is not of the same data type kind (boolean, integer, or floating-point) as the resolved output array data type (see :ref:`type-promotion`), behavior is unspecified and, thus, implementation-defined.
201
206
202
207
device: Optional[device]
203
208
device on which to place the created array. If ``device`` is ``None``, the output array device must be inferred from ``x``. Default: ``None``.
0 commit comments