def test_coercions(self): f, values, graph = make_graph() explicit_coercions(f) ops = [(op.opcode, op.type) for op in f.ops][:-1] expected = [('convert', dshape("10, float64")), ('kernel', dshape("10, float64")), ('convert', dshape("10, cfloat64")), ('kernel', dshape("10, cfloat64"))] self.assertEqual(ops, expected)
def test_ir(self): f, values, 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, cfloat64")] self.assertEqual(got, expected)