Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.rsqrt function

PyTorch torch.rsqrt function


PyTorch torch reference manual 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

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual