YouTip LogoYouTip

Pytorch Torch Randint_Like

# PyTorch torch.randint_like Function * * Pytorch torch Reference Manual](#) `torch.randint_like` is a function in PyTorch used to create an integer random tensor with the same shape as the input tensor. ### Function Definition torch.randint_like(input, low=0, high, dtype=None, device=None, requires_grad=False) * * * ## Usage Example ## Example import torch # Create an input tensor input= torch.tensor([[1,2],[3,4]]) # Create an integer random tensor with the same shape as the input, range [0, 10) x = torch.randint_like(input,10) print(x) * * Pytorch torch Reference Manual](#)
← Pytorch Torch Randn_LikePytorch Torch Rand_Like β†’