MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle-Lite / CheckProgramDescValidity

Function CheckProgramDescValidity

lite/core/program.cc:41–51  ·  view source on GitHub ↗

Verify the validity of ProgramDesc

Source from the content-addressed store, hash-verified

39namespace {
40// Verify the validity of ProgramDesc
41void CheckProgramDescValidity(std::shared_ptr<cpp::ProgramDesc> program_desc,
42 int inst_block_size) {
43 CHECK(program_desc) << "Error, program_desc is nullptr";
44 auto block_size = program_desc->BlocksSize();
45 CHECK_GT(block_size, 0) << "No block exists in current program_desc";
46 // TODD(hong19860320) Only support updating the block desc which already
47 // exists in the origin program desc
48 CHECK_LE(block_size, inst_block_size) << "Invalid block size, expected (0,"
49 << inst_block_size << "] but got "
50 << block_size;
51}
52
53std::map<std::string, cpp::VarDesc> ClearBlockDescInfo(
54 cpp::BlockDesc* block_desc) {

Callers 1

Calls 1

BlocksSizeMethod · 0.45

Tested by

no test coverage detected