def testIssue1379(self):

    def fun(pred):
        return lax.cond(pred, (lambda x: (True, x)), (lambda x: (False, x)), pred)

    @api.jit
    def cfun(pred):
        return fun(pred)
    self.assertEqual(fun(0), cfun(0), (False, 0))
    self.assertEqual(fun(0.0), cfun(0.0), (False, 0.0))
    self.assertEqual(fun(1), cfun(1), (True, 1))
    self.assertEqual(fun(1.0), cfun(1.0), (True, 1.0))
    for pred in ['abc', [], [1, 2]]:
        for f in [fun, cfun]:
            self.assertRaises(TypeError, f, pred)
def testIssue1379(self):

    def fun(pred):
        return lax.cond(pred, (lambda x: (True, x)), (lambda x: (False, x)), pred)

    @api.jit
    def cfun(pred):
        return fun(pred)
    self.assertEqual(fun(0), cfun(0), (False, 0))
    self.assertEqual(fun(0.0), cfun(0.0), (False, 0.0))
    self.assertEqual(fun(1), cfun(1), (True, 1))
    self.assertEqual(fun(1.0), cfun(1.0), (True, 1.0))
    for pred in ['abc', [], [1, 2]]:
        for f in [fun, cfun]:
            self.assertRaises(TypeError, f, pred)