Пример #1
0
 def test_reduce_mean_torch_value(self):
     self.assertAlmostEqual(reduce_std(self.test_torch).numpy(),
                            2.114,
                            delta=0.001)
Пример #2
0
 def test_reduce_mean_np_value(self):
     self.assertAlmostEqual(reduce_std(self.test_np), 0.829, delta=0.001)
Пример #3
0
 def test_reduce_mean_torch_type(self):
     self.assertIsInstance(reduce_std(self.test_torch), torch.Tensor,
                           'Output type must be torch.Tensor')
Пример #4
0
 def test_reduce_mean_np_type(self):
     self.assertIsInstance(reduce_std(self.test_np), np.ScalarType,
                           'Output type must be NumPy')