Esempio n. 1
0
 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
Esempio n. 2
0
 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])
Esempio n. 3
0
 def test_different_size(self):
     a = core.ndarray((2, 3))
     self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 5)), [])
Esempio n. 4
0
 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])
Esempio n. 5
0
 def test_different_size(self):
     a = core.ndarray((2, 3))
     self.assertEqual(core._get_strides_for_nocopy_reshape(a, (1, 5)),
                      [])