PyTorch torch.rsqrt Function
Pytorch torch Reference Manual
torch.rsqrtIt is a function in PyTorch used to compute the element-wise reciprocal of the square root.
Function Definition
torch.rsqrt(input, out=None)
Usage Example
Example
import torch
# Compute the reciprocal of the square root
x = torch.tensor([1.0, 4.0, 9.0])
result = torch.rsqrt(x)
print(result)
# Compute the reciprocal of the square root
x = torch.tensor([1.0, 4.0, 9.0])
result = torch.rsqrt(x)
print(result)
Other Extensions