def test_reduce_sum_axis(self): self.assertTrue( np.array_equal(reduce_sum(self.test_np, axis=0), [4, 5]))
def test_reduce_sum_torch_value(self): self.assertTrue(np.array_equal(reduce_sum(self.test_torch).numpy(), 6))
def test_reduce_sum_torch_type(self): self.assertIsInstance(reduce_sum(self.test_torch), torch.Tensor, 'Output type must be torch.Tensor')
def test_reduce_sum_tf_type(self): self.assertIsInstance(reduce_sum(self.test_tf), tf.Tensor, 'Output type must be tf.Tensor')
def test_reduce_sum_np_value(self): self.assertEqual(reduce_sum(self.test_np), 9)
def test_reduce_sum_np_type(self): self.assertIsInstance(reduce_sum(self.test_np), np.ScalarType, 'Output type must be NumPy')