torch.rsqrt
-
torch.rsqrt(input, *, out=None) → Tensor
返回一个新张量,其中包含 input
中每个元素的平方根的倒数。
outi=inputi1
- 参数:
input (Tensor) – 输入张量。
- 关键字参数:
输出(张量,可选)- 输出张量。
示例:
>>> a = torch.randn(4)
>>> a
tensor([-0.0370, 0.2970, 1.5420, -0.9105])
>>> torch.rsqrt(a)
tensor([ nan, 1.8351, 0.8053, nan])