Пример #1
0
 def test_roll_torch_1d_shift(self):
     output = roll(self.test_torch, shift=1, axis=0)
     self.assertTrue(is_equal(output, self.test_output_torch_1d))
Пример #2
0
 def test_roll_torch_2d_shift(self):
     output = roll(self.test_torch, shift=[-1, -1], axis=[0, 1])
     self.assertTrue(is_equal(output, self.test_output_torch_2d))
Пример #3
0
 def test_sign_torch_type(self):
     output = roll(self.test_torch, shift=1, axis=0)
     self.assertIsInstance(output, torch.Tensor,
                           'Output type must be torch.Tensor')
Пример #4
0
 def test_roll_tf_type(self):
     output = roll(self.test_tf, shift=0, axis=1)
     self.assertIsInstance(output, tf.Tensor,
                           'Output type must be tf.Tensor')
Пример #5
0
 def test_roll_np_2d_shift(self):
     output = roll(self.test_np, shift=[-1, -1], axis=[0, 1])
     self.assertTrue(np.array_equal(output, self.test_output_np_2d))
Пример #6
0
 def test_roll_np_1d_shift(self):
     output = roll(self.test_np, shift=1, axis=0)
     self.assertTrue(np.array_equal(output, self.test_output_np_1d))
Пример #7
0
 def test_roll_np_type(self):
     output = roll(self.test_np, shift=1, axis=0)
     self.assertIsInstance(output, np.ndarray,
                           'Output type must be NumPy array')