rsqrt¶
- nvtripy.rsqrt(input: Tensor) Tensor[source]¶
Computes the elementwise reciprocal square root of the elements of the input tensor.
- Parameters:
input (Tensor) – The input tensor.
- Returns:
A new tensor of the same shape as the input tensor.
- Return type:
- INPUT REQUIREMENTS:
- OUTPUT GUARANTEES:
return[0].dtype==input.dtype
Example
1input = tp.arange(3, dtype=tp.float32) + 1.0 2output = tp.rsqrt(input)
Local Variables¶>>> input tensor([1, 2, 3], dtype=float32, loc=gpu:0, shape=(3,)) >>> output tensor([1, 0.707107, 0.57735], dtype=float32, loc=gpu:0, shape=(3,))