full_like¶
- full_like(x: array, /, fill_value: bool | int | float | complex, *, dtype: dtype | None = None, device: device | None = None) array¶
- Returns a new array filled with - fill_valueand having the same- shapeas an input array- x.- Parameters:
- x (array) – input array from which to derive the output array shape. 
- fill_value (Union[bool, int, float, complex]) – fill value. 
- dtype (Optional[dtype]) – - output array data type. If - dtypeis- None, the output array data type must be inferred from- x. Default:- None.- Note - If the - fill_valueexceeds the precision of the resolved output array data type, behavior is unspecified and, thus, implementation-defined.- Note - If the - fill_valuehas 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 Type Promotion Rules), behavior is unspecified and, thus, implementation-defined.
- device (Optional[device]) – device on which to place the created array. If - deviceis- None, the output array device must be inferred from- x. Default:- None.
 
- Returns:
- out (array) – an array having the same shape as - xand where every element is equal to- fill_value.
 - Notes - Changed in version 2022.12: Added complex data type support.