Beispiel #1
0
 def test_4(self):
     a = np.arange(10)
     b = aobj.as_strided(a, (8,))
     self.assertAllclose(a[:8], b)
Beispiel #2
0
 def test_2(self):
     a = np.arange(10)
     b = aobj.as_strided(a, (8,), a.strides, a.strides[0] * 2)
     self.assertAllclose(a[2:], b)
Beispiel #3
0
 def test_3(self):
     a = np.arange(10)
     b = aobj.as_strided(a, (4,), (a.strides[0] * 2,), a.strides[0] * 2)
     self.assertAllclose(a[2::2], b)
Beispiel #4
0
 def test_1(self):
     a = np.arange(10)
     b = aobj.as_strided(a)
     self.assertAllclose(a, b)