oneflow.rsqrt¶
-
oneflow.
rsqrt
()¶ Returns a new tensor with the reciprocal of the square-root of each of the elements of
input
.\[\text{out}_{i} = \frac{1}{\sqrt{\text{input}_{i}}}\]- Parameters
input – the input tensor.
>>> import oneflow as flow >>> import numpy as np >>> a = flow.tensor(np.array([1.0, 2.0, 3.0]), dtype=flow.float32) >>> out = flow.rsqrt(a).numpy() >>> out array([1. , 0.70710677, 0.57735026], dtype=float32)