@switch_to_static_graph
def _append_backward_desc(self, main_program):
    program = _change_is_test_status(main_program.clone(), is_test=False)
    targets = []
    for out in self._outputs.tolist():
        if isinstance(out, framework.Variable):
            targets.append(program.global_block().var(out.name))
    if (targets and self._params):
        backward.gradients(targets=targets, inputs=[])
    return program
@switch_to_static_graph
def _append_backward_desc(self, main_program):
    program = _change_is_test_status(main_program.clone(), is_test=False)
    targets = []
    for out in self._outputs.tolist():
        if isinstance(out, framework.Variable):
            targets.append(program.global_block().var(out.name))
    if (targets and self._params):
        backward.gradients(targets=targets, inputs=[])
    return program