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