torch.full_like — PyTorch 2.7 documentation (original) (raw)

torch.full_like(input, fill_value, \*, dtype=None, layout=torch.strided, device=None, requires_grad=False, memory_format=torch.preserve_format) → Tensor

Returns a tensor with the same size as input filled with fill_value.torch.full_like(input, fill_value) is equivalent totorch.full(input.size(), fill_value, dtype=input.dtype, layout=input.layout, device=input.device).

Parameters

Keyword Arguments