MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _get_strong_program_cache_key

Function _get_strong_program_cache_key

python/paddle/base/executor.py:660–677  ·  view source on GitHub ↗
(program, feed, fetch_list)

Source from the content-addressed store, hash-verified

658
659
660def _get_strong_program_cache_key(program, feed, fetch_list):
661 # TODO(zhiqiu): use hash_str to generate cache key as above
662 def _get_varname_from_block(block):
663 block_str = []
664 for var_name in list(block.vars.keys()):
665 block_str.append(var_name)
666 return "\n".join(block_str)
667
668 inner_program = (
669 program._program
670 if isinstance(program, compiler.CompiledProgram)
671 else program
672 )
673 return (
674 _get_varname_from_block(inner_program.blocks[0])
675 + str(id(program))
676 + _get_program_cache_key(feed, fetch_list)
677 )
678
679
680def _get_feed_fetch_var_names(feed, fetch_list):

Callers 3

_run_implMethod · 0.85
_run_from_datasetMethod · 0.85
_prepare_pipeline_ctxMethod · 0.85

Calls 4

_get_varname_from_blockFunction · 0.85
strFunction · 0.85
_get_program_cache_keyFunction · 0.85
idFunction · 0.50

Tested by

no test coverage detected