Пример #1
0
    def test_reshape(self):
        d = crh.copy(self.c)
        crh.reshape(d, (4, 5))
        assert_array_equal(crh.todense(d), self.dense[:4, :])

        crh.reshape(d, (5, 5))
        crh.reshape(d)
        assert_array_equal(crh.get_shape(d), (4, 5))
Пример #2
0
    def test_reshape(self):
        d = crh.copy(self.c)
        crh.reshape(d, (4, 5))
        assert_array_equal(crh.todense(d), self.dense[:4, :])

        crh.reshape(d, (5, 5))
        crh.reshape(d)
        assert_array_equal(crh.get_shape(d), (4, 5))
Пример #3
0
 def test_contains(self):
     d = crh.todense(self.c)
     for y, x in np.ndindex(crh.get_shape(self.c)):
         crh.contains(self.c, y, x) == d[y, x]
Пример #4
0
 def test_contains(self):
     d = crh.todense(self.c)
     for y, x in np.ndindex(crh.get_shape(self.c)):
         crh.contains(self.c, y, x) == d[y, x]