PyTorch torch.rsqrt function
PyTorch torch reference manual
torch.rsqrt is a function in PyTorch used to compute the element-wise reciprocal of the square root.
Function definition
torch.rsqrt(input, out=None)
Usage examples
Example
import
torch
Compute the reciprocal square root
x
=
torch.
tensor
(
[
1.0
,
4.0
,
9.0
]
)
result
=
torch.
rsqrt
(
x
)
(
result
)