YouTip LogoYouTip

Pytorch Torch Zeros_Like

# PyTorch torch.zeros_like Function * * Pytorch torch Reference Manual](#) `torch.zeros_like` is a function in PyTorch used to create a zero-filled tensor with the same shape as the input tensor. ### Function Definition torch.zeros_like(input, dtype=None, device=None, requires_grad=False) * * * ## Usage Example ## Example import torch x = torch.randn(3,4) y = torch.zeros_like(x) print("x shape:", x.shape) print("y shape:", y.shape) print(y) * * Pytorch torch Reference Manual](#)
← Pytorch Torch Nn AdaptiveavgpoPytorch Torch Xlogy β†’