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

Method GetFeedTargetNames

paddle/fluid/framework/program_desc.cc:194–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194const std::vector<std::string> ProgramDesc::GetFeedTargetNames() {
195 auto &global_block = Block(0);
196 // The order of feed_target_names must follow the index specified in `col`.
197 // since feed operator's order doesn't necessary follow 'col'.
198 std::vector<std::string> feed_target_names;
199 for (auto *op : global_block.AllOps()) {
200 if (op->Type() == kFeedOpType) {
201 size_t col = PADDLE_GET_CONST(int, op->GetAttr("col"));
202 if (col >= feed_target_names.size()) {
203 feed_target_names.resize(col + 1);
204 }
205 feed_target_names[col] = op->Output("Out")[0];
206 }
207 }
208 return feed_target_names;
209}
210
211const std::vector<std::string> ProgramDesc::GetFetchTargetNames() {
212 auto &global_block = Block(0);

Callers 3

FunctionInfoMethod · 0.80
GetFeedTargetShapesFunction · 0.80
TestInferenceFunction · 0.80

Calls 8

PADDLE_GET_CONSTFunction · 0.85
AllOpsMethod · 0.80
BlockFunction · 0.70
TypeMethod · 0.45
GetAttrMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
OutputMethod · 0.45

Tested by 2

GetFeedTargetShapesFunction · 0.64
TestInferenceFunction · 0.64