Exemple #1
0
 def test_coercions(self):
     f, graph = make_graph()
     coercions.run(f)
     ops = [(op.opcode, op.type) for op in f.ops][:-1]
     expected = [('convert', dshape("10, float64")),
                 ('kernel', dshape("10, float64")),
                 ('convert', dshape("10, complex[float64]")),
                 ('kernel', dshape("10, complex[float64]"))]
     self.assertEqual(ops, expected)
 def test_coercions(self):
     f, graph = make_graph()
     coercions.run(f)
     ops = [(op.opcode, op.type) for op in f.ops][:-1]
     expected = [('convert', dshape("10 * float64")),
                 ('kernel', dshape("10 * float64")),
                 ('convert', dshape("10 * complex[float64]")),
                 ('kernel', dshape("10 * complex[float64]"))]
     self.assertEqual(ops, expected)
    def test_ir(self):
        f, graph = make_graph()

        # Structure
        self.assertEqual(len(f.blocks), 1)
        self.assertTrue(f.startblock.is_terminated())

        # Types
        got      = [op.type for op in f.ops][:-1]
        expected = [dshape("10 * float64"), dshape("10 * complex[float64]")]
        self.assertEqual(got, expected)
Exemple #4
0
    def test_ir(self):
        f, graph = make_graph()

        # Structure
        self.assertEqual(len(f.blocks), 1)
        self.assertTrue(f.startblock.is_terminated())

        # Types
        got = [op.type for op in f.ops][:-1]
        expected = [dshape("10, float64"), dshape("10, complex[float64]")]
        self.assertEqual(got, expected)