Beispiel #1
0
 def test_reshape_torch_value(self):
     self.assertEqual(
         reshape(self.test_torch, shape=(2, 3)).numpy().shape, (2, 3))
Beispiel #2
0
 def test_reshape_np_value(self):
     self.assertEqual(reshape(self.test_np, shape=(4, )).shape, (4, ))
Beispiel #3
0
 def test_reshape_torch_type(self):
     self.assertIsInstance(reshape(self.test_torch, shape=(2, 3)),
                           torch.Tensor, 'Output type must be torch.Tensor')
Beispiel #4
0
 def test_reshape_np_type(self):
     self.assertIsInstance(reshape(self.test_np, shape=(4, )),
                           (np.ndarray, np.ScalarType),
                           'Output type must be NumPy')