def _prune_unused_params(self, program):
    '\n        Prune the parameters not used anywhere in the program.\n        The `@declarative` may only decorated a sub function which\n        contains some unused parameters created in `__init__`.\n        So prune these parameters to avoid unnecessary operations in\n        `run_program_op`.\n        '
    required_params = []
    for param in self._params:
        found_param = False
        for block in program.blocks:
            for op in block.ops:
                if ((param.name in op.input_arg_names) or (param.name in op.output_arg_names)):
                    required_params.append(param)
                    found_param = True
                    break
            if found_param:
                break
    self._params = required_params
Prune the parameters not used anywhere in the program.
The `@declarative` may only decorated a sub function which
contains some unused parameters created in `__init__`.
So prune these parameters to avoid unnecessary operations in
`run_program_op`.
def _prune_unused_params(self, program):
    '\n        Prune the parameters not used anywhere in the program.\n        The `@declarative` may only decorated a sub function which\n        contains some unused parameters created in `__init__`.\n        So prune these parameters to avoid unnecessary operations in\n        `run_program_op`.\n        '
    required_params = []
    for param in self._params:
        found_param = False
        for block in program.blocks:
            for op in block.ops:
                if ((param.name in op.input_arg_names) or (param.name in op.output_arg_names)):
                    required_params.append(param)
                    found_param = True
                    break
            if found_param:
                break
    self._params = required_params