Пример #1
0
 def test_random_uniform_tf_value(self):
     output_shape = tf.shape([2, 2])
     self.assertTrue(
         tf.reduce_all(
             tf.equal(tf.shape(random_uniform_like(self.test_tf)),
                      output_shape)),
         'Output tensor shape should be same as input')
Пример #2
0
 def test_random_uniform_torch_value(self):
     output_shape = (2, 2)
     self.assertTrue(
         (random_uniform_like(self.test_torch).size() == output_shape),
         'Output tensor shape should be same as input')
Пример #3
0
 def test_random_uniform_torch_type(self):
     self.assertIsInstance(random_uniform_like(self.test_torch),
                           torch.Tensor, 'Output must be torch.Tensor')
Пример #4
0
 def test_random_uniform_tf_type(self):
     self.assertIsInstance(random_uniform_like(self.test_tf), tf.Tensor,
                           'Output type must be tf.Tensor')
Пример #5
0
 def test_random_uniform_np_value(self):
     self.assertTrue((random_uniform_like(self.test_np).shape == (2, 2)),
                     'Output array shape should be same as input')
Пример #6
0
 def test_random_uniform_np_type(self):
     self.assertIsInstance(random_uniform_like(self.test_np), np.ndarray,
                           'Output must be NumPy Array')