def test_recompute_lamb_optimizer(self):
    (train_prog, startup_prog) = (fluid.Program(), fluid.Program())
    (avg_cost, strategy) = self.net(train_prog, startup_prog)
    self.set_strategy(strategy, 'recompute')
    self.set_strategy(strategy, 'lamb')
    self.optimizer(avg_cost, strategy, train_prog, startup_prog, 'adam')
    ops = [op.type for op in avg_cost.block.ops]
    outs = [op.output('Out')[0] for op in avg_cost.block.ops if (op.type == 'mul')]
    self.assertIn('subprog', ''.join(outs))
    self.assertIn('lamb', ops)
def test_recompute_lamb_optimizer(self):
    (train_prog, startup_prog) = (fluid.Program(), fluid.Program())
    (avg_cost, strategy) = self.net(train_prog, startup_prog)
    self.set_strategy(strategy, 'recompute')
    self.set_strategy(strategy, 'lamb')
    self.optimizer(avg_cost, strategy, train_prog, startup_prog, 'adam')
    ops = [op.type for op in avg_cost.block.ops]
    outs = [op.output('Out')[0] for op in avg_cost.block.ops if (op.type == 'mul')]
    self.assertIn('subprog', .join(outs))
    self.assertIn('lamb', ops)