def test_ndarray(self, order): order_expect = _orders[order] a = core.ndarray((2, 3), order=order) expect_c = order_expect == 'C' expect_f = order_expect == 'F' assert a.flags.c_contiguous == expect_c assert a.flags.f_contiguous == expect_f
def test_one(self): a = core.ndarray((1, ), dtype=cupy.int32) self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 1, 1)), [4, 4, 4])
def test_different_size(self): a = core.ndarray((2, 3)) self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 5)), [])
def test_one(self): a = core.ndarray((1,), dtype=cupy.int32) self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 1, 1)), [4, 4, 4])