Example #1
0
 def test_tensor_sqrt_torch_value(self):
     self.assertTrue(
         torch.allclose(tensor_sqrt(self.test_torch),
                        self.test_output_torch))
Example #2
0
 def test_tensor_sqrt_torch_type(self):
     self.assertIsInstance(tensor_sqrt(self.test_torch), torch.Tensor,
                           'Output type must be torch.Tensor')
Example #3
0
 def test_tensor_sqrt_tf_value(self):
     self.assertTrue(
         np.allclose(
             tensor_sqrt(self.test_tf).numpy(),
             self.test_output_tf.numpy()))
Example #4
0
 def test_tensor_sqrt_tf_type(self):
     self.assertIsInstance(tensor_sqrt(self.test_tf), tf.Tensor,
                           'Output type must be tf.Tensor')
Example #5
0
 def test_tensor_sqrt_np_value(self):
     self.assertTrue(
         np.allclose(tensor_sqrt(self.test_np), self.test_output_np))
Example #6
0
 def test_tensor_sqrt_np_type(self):
     self.assertIsInstance(tensor_sqrt(self.test_np), np.ndarray,
                           'Output type must be NumPy array')