Example #1
0
    def testNegative(self):
        t1 = tensor([[0, 1, 0], [1, 0, 0]], chunks=2).tosparse()

        t = negative(t1)
        self.assertTrue(t.issparse())
        self.assertIs(type(t), SparseTensor)

        t.tiles()
        self.assertTrue(t.chunks[0].op.sparse)
Example #2
0
    def testNegative(self):
        t1 = tensor([[0, 1, 0], [1, 0, 0]], chunk_size=2).tosparse()

        t = negative(t1)
        self.assertTrue(t.issparse())
        self.assertIs(type(t), SparseTensor)
        self.assertEqual(calc_shape(t), t.shape)

        t.tiles()
        self.assertTrue(t.chunks[0].op.sparse)
        self.assertEqual(calc_shape(t.chunks[0]), t.chunks[0].shape)