def testCondOneBranchConstant(self):

    def fun(x):
        if (x < 3):
            return 5.0
        else:
            return x

    @api.jit
    def cfun(x):
        return lax.cond(lax.lt(x, 3), (lambda x: 5), (lambda x: x), x)
    self.assertEqual(fun(0), cfun(0))
    self.assertEqual(cfun(0), 5)
    self.assertEqual(fun(4), cfun(4))
    self.assertEqual(cfun(4), 4)
def testCondOneBranchConstant(self):

    def fun(x):
        if (x < 3):
            return 5.0
        else:
            return x

    @api.jit
    def cfun(x):
        return lax.cond(lax.lt(x, 3), (lambda x: 5), (lambda x: x), x)
    self.assertEqual(fun(0), cfun(0))
    self.assertEqual(cfun(0), 5)
    self.assertEqual(fun(4), cfun(4))
    self.assertEqual(cfun(4), 4)