Beispiel #1
0
 def test_rsqrt_tensor_function(test_case):
     np_arr = np.random.rand(3, 2, 5, 7)
     np_out = 1 / np.sqrt(np_arr)
     x = flow.Tensor(np_arr)
     of_out = flow.rsqrt(x)
     test_case.assertTrue(
         np.allclose(of_out.numpy(), np_out, 1e-05, 1e-05, equal_nan=True)
     )
Beispiel #2
0
def _rsqrt(self):
    return flow.rsqrt(self)