fullc¶
- fullc(tensor: Tensor, value: bool | int | float | complex, *, shape: Sequence[int] | Size | None = None, dtype: dtype | None = None, layout: layout | None = None, device: device | None = None, requires_grad: bool | None = None) Tensor[source]¶
Returns a float or complex tensor based on input filled with specified value.
This is like
full()except ifdtypeisNoneand the datatype oftensoris neither floating point nor complex, the default float type will be used.- Parameters:
tensor (torch.Tensor) – determines default output properties.
value (bool | int | float | complex) – value with to fill the output.
shape (Sequence[int] | torch.Size | None, optional) – overrides shape from
tensorif specified. Defaults toNone.dtype (torch.dtype | None, optional) – overrides data type from
tensorif specified. Defaults toNone.layout (torch.layout | None, optional) – overrides layout from
tensorif specified. Defaults toNone.device (torch.device | None, optional) – overrides device from
tensorif specified. Defaults toNone.requires_grad (bool | None, optional) – overrides gradient requirement from
tensorif specified. Defaults toNone.
- Returns:
tensor like
tensor, modified by parameters, filled withvalue.- Return type:
Note
To construct a scalar, set
shapeto().