()
| 2686 | dataset = _get_dataset() |
| 2687 | |
| 2688 | def _get_real_program_fetch_list(): |
| 2689 | real_program = program._pipeline_opt["section_program"] |
| 2690 | real_fetch_list = [] |
| 2691 | for fetch_var in fetch_list: |
| 2692 | if isinstance(fetch_var, Variable): |
| 2693 | fetch_var_name = fetch_var.name |
| 2694 | else: |
| 2695 | fetch_var_name = fetch_var |
| 2696 | if fetch_var_name in real_program.global_block().vars: |
| 2697 | real_fetch_list.append(fetch_var) |
| 2698 | |
| 2699 | real_program = _add_feed_fetch_ops( |
| 2700 | program=real_program, |
| 2701 | feed=[], |
| 2702 | fetch_list=real_fetch_list, |
| 2703 | feed_var_name='feed', |
| 2704 | fetch_var_name='fetch', |
| 2705 | ) |
| 2706 | main_block = real_program.block(0) |
| 2707 | for op in main_block.ops: |
| 2708 | # set the op_role of fetch op to Optimize to avoid |
| 2709 | # erase the fetched vars by gc for pipeline |
| 2710 | if op.type == 'fetch': |
| 2711 | op._set_attr( |
| 2712 | 'op_role', |
| 2713 | core.op_proto_and_checker_maker.OpRole.Optimize, |
| 2714 | ) |
| 2715 | return real_program, real_fetch_list |
| 2716 | |
| 2717 | real_program, real_fetch_list = _get_real_program_fetch_list() |
| 2718 |
nothing calls this directly
no test coverage detected