PyTorch torch.rsqrt Function


Pytorch torch 参考手册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)

Pytorch torch 参考手册Pytorch torch Reference Manual

Other Extensions