@@ -0,0 +1,2489 @@
+import unittest%0A%0Aimport cupy%0Afrom cupy.core import core%0A%0A%0Aclass TestGetSize(unittest.TestCase):%0A%0A    def test_none(self):%0A        self.assertEqual(core.get_size(None), ())%0A%0A    def test_list(self):%0A        self.assertEqual(core.get_size(%5B1, 2%5D), (1, 2))%0A%0A    def test_tuple(self):%0A        self.assertEqual(core.get_size((1, 2)), (1, 2))%0A%0A    def test_int(self):%0A        self.assertEqual(core.get_size(1), (1,))%0A%0A    def test_invalid(self):%0A        with self.assertRaises(ValueError):%0A            core.get_size(1.0)%0A%0A%0Aclass TestInternalProd(unittest.TestCase):%0A%0A    def test_empty(self):%0A        self.assertEqual(core.internal_prod(%5B%5D), 1)%0A%0A    def test_one(self):%0A        self.assertEqual(core.internal_prod(%5B2%5D), 2)%0A%0A    def test_two(self):%0A        self.assertEqual(core.internal_prod(%5B2, 3%5D), 6)%0A%0A%0Aclass TestGetStridesForNocopyReshape(unittest.TestCase):%0A%0A    def test_different_size(self):%0A        a = core.ndarray((2, 3))%0A        self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 5)),%0A                         %5B%5D)%0A%0A    def test_one(self):%0A        a = core.ndarray((1,), dtype=cupy.int32)%0A        self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 1, 1)),%0A                         %5B4, 4, 4%5D)%0A%0A    def test_normal(self):%0A        # TODO(nno): write test for normal case%0A        pass%0A%0A%0Aclass TestGetContiguousStrides(unittest.TestCase):%0A%0A    def test_zero(self):%0A        self.assertEqual(core._get_contiguous_strides((), 1), %5B%5D)%0A%0A    def test_one(self):%0A        self.assertEqual(core._get_contiguous_strides((1,), 2), %5B2%5D)%0A%0A    def test_two(self):%0A        self.assertEqual(core._get_contiguous_strides((1, 2), 3), %5B6, 3%5D)%0A%0A    def test_three(self):%0A        self.assertEqual(core._get_contiguous_strides((1, 2, 3), 4),%0A                         %5B24, 12, 4%5D)%0A%0A%0Aclass TestGetCContiguity(unittest.TestCase):%0A%0A    def test_zero_in_shape(self):%0A        self.assertTrue(core._get_c_contiguity((1, 0, 1), (1, 1, 1), 3))%0A%0A    def test_normal(self):%0A        # TODO(unno): write test for normal case%0A        pass%0A%0A%0Aclass TestInferUnknownDimension(unittest.TestCase):%0A%0A    def test_known_all(self):%0A        self.assertEqual(core._infer_unknown_dimension((1, 2, 3), 6),%0A                         %5B1, 2, 3%5D)%0A%0A    def test_multiple_unknown(self):%0A        with self.assertRaises(ValueError):%0A            core._infer_unknown_dimension((-1, 1, -1), 10)%0A%0A    def test_infer(self):%0A        self.assertEqual(core._infer_unknown_dimension((-1, 2, 3), 12),%0A                         %5B2, 2, 3%5D)%0A

Write test for core module of cupy