def _run_program(self, program, exe, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache):
    if (feed is None):
        feed = {}
    elif isinstance(feed, (list, tuple)):
        assert (len(feed) == 1), 'Not compiled with data parallel'
        feed = feed[0]
    if (not isinstance(feed, dict)):
        raise TypeError(('feed requires dict as its Parameter. But you passed in %s' % type(feed)))
    if (program is None):
        program = default_main_program()
    if (not isinstance(program, Program)):
        raise TypeError(('Executor requires Program as its Parameter. But you passed in %s' % type(program)))
    if use_program_cache:
        cache_key = _get_strong_program_cache_key(program, feed, fetch_list)
        cached_program = self._get_program_cache(cache_key)
        cached_ctx = self._get_ctx_cache(cache_key)
        cached_scope = self._get_scope_cache(cache_key)
        cached_var = self._get_var_cache(cache_key)
        if (cached_program is None):
            cached_program = self._add_feed_fetch_ops(program=program, feed=feed, fetch_list=fetch_list, feed_var_name=feed_var_name, fetch_var_name=fetch_var_name)
            self._add_program_cache(cache_key, cached_program)
            fetch_list_str = list(map(_to_name_str, fetch_list))
            cached_ctx = self._default_executor.prepare_ctx_cache(cached_program.desc, 0, fetch_list_str, False)
            cached_var = self._default_executor.create_variables(cached_program.desc, scope, 0)
            cached_scope = scope.new_scope()
            self._add_ctx_cache(cache_key, cached_ctx)
            self._add_var_cache(cache_key, cached_var)
            self._add_scope_cache(cache_key, cached_scope)
        program = cached_program
        ctx = cached_ctx
        scope = cached_scope
        var = cached_var
    else:
        program = self._add_feed_fetch_ops(program=program, feed=feed, fetch_list=fetch_list, feed_var_name=feed_var_name, fetch_var_name=fetch_var_name)
    self._feed_data(program, feed, feed_var_name, scope)
    if (not use_program_cache):
        exe.run(program.desc, scope, 0, True, True, fetch_var_name)
    else:
        exe.run_cached_prepared_ctx(ctx, scope, False, False, False)
    outs = self._fetch_data(fetch_list, fetch_var_name, scope)
    if return_numpy:
        outs = as_numpy(outs)
    return outs
def _run_program(self, program, exe, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache):
    if (feed is None):
        feed = {}
    elif isinstance(feed, (list, tuple)):
        assert (len(feed) == 1), 'Not compiled with data parallel'
        feed = feed[0]
    if (not isinstance(feed, dict)):
        raise TypeError(('feed requires dict as its Parameter. But you passed in %s' % type(feed)))
    if (program is None):
        program = default_main_program()
    if (not isinstance(program, Program)):
        raise TypeError(('Executor requires Program as its Parameter. But you passed in %s' % type(program)))
    if use_program_cache:
        cache_key = _get_strong_program_cache_key(program, feed, fetch_list)
        cached_program = self._get_program_cache(cache_key)
        cached_ctx = self._get_ctx_cache(cache_key)
        cached_scope = self._get_scope_cache(cache_key)
        cached_var = self._get_var_cache(cache_key)
        if (cached_program is None):
            cached_program = self._add_feed_fetch_ops(program=program, feed=feed, fetch_list=fetch_list, feed_var_name=feed_var_name, fetch_var_name=fetch_var_name)
            self._add_program_cache(cache_key, cached_program)
            fetch_list_str = list(map(_to_name_str, fetch_list))
            cached_ctx = self._default_executor.prepare_ctx_cache(cached_program.desc, 0, fetch_list_str, False)
            cached_var = self._default_executor.create_variables(cached_program.desc, scope, 0)
            cached_scope = scope.new_scope()
            self._add_ctx_cache(cache_key, cached_ctx)
            self._add_var_cache(cache_key, cached_var)
            self._add_scope_cache(cache_key, cached_scope)
        program = cached_program
        ctx = cached_ctx
        scope = cached_scope
        var = cached_var
    else:
        program = self._add_feed_fetch_ops(program=program, feed=feed, fetch_list=fetch_list, feed_var_name=feed_var_name, fetch_var_name=fetch_var_name)
    self._feed_data(program, feed, feed_var_name, scope)
    if (not use_program_cache):
        exe.run(program.desc, scope, 0, True, True, fetch_var_name)
    else:
        exe.run_cached_prepared_ctx(ctx, scope, False, False, False)
    outs = self._fetch_data(fetch_list, fetch_var_name, scope)
    if return_numpy:
        outs = as_numpy(outs)
    return outs