full¶
- full(shape: int | Tuple[int, ...], fill_value: int | float, *, dtype: dtype | None = None, device: device | None = None) array¶
Returns a new array having a specified
shapeand filled withfill_value.- Parameters:
shape (Union[int, Tuple[int, ...]]) – output array shape.
fill_value (Union[int, float]) – fill value.
dtype (Optional[dtype]) –
output array data type. If
dtypeisNone, the output array data type must be inferred fromfill_value. If the fill value is anint, the output array data type must be the default integer data type. If the fill value is afloat, the output array data type must be the default floating-point data type. If the fill value is abool, the output array must have boolean data type. Default:None.Note
If the
fill_valueexceeds the precision of the resolved default output array data type, behavior is left unspecified and, thus, implementation-defined.device (Optional[device]) – device on which to place the created array. Default:
None.
- Returns:
out (array) – an array where every element is equal to
fill_value.