MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ParseInstructionNames

Method ParseInstructionNames

tensorflow/compiler/xla/service/hlo_parser.cc:2160–2181  ·  view source on GitHub ↗

'{' name+ '}'

Source from the content-addressed store, hash-verified

2158
2159// '{' name+ '}'
2160bool HloParserImpl::ParseInstructionNames(
2161 std::vector<HloInstruction*>* instructions) {
2162 if (!ParseToken(TokKind::kLbrace,
2163 "expects '{' at the beginning of instruction name list")) {
2164 return false;
2165 }
2166 LocTy loc = lexer_.GetLoc();
2167 do {
2168 std::string name;
2169 if (!ParseName(&name)) {
2170 return Error(loc, "expects a instruction name");
2171 }
2172 std::pair<HloInstruction*, LocTy>* instr = FindInstruction(name);
2173 if (!instr) {
2174 return TokenError(StrFormat("instruction '%s' is not defined", name));
2175 }
2176 instructions->push_back(instr->first);
2177 } while (EatIfPresent(TokKind::kComma));
2178
2179 return ParseToken(TokKind::kRbrace,
2180 "expects '}' at the end of instruction name list");
2181}
2182
2183bool HloParserImpl::SetValueInLiteral(LocTy loc, int64 value, int64 index,
2184 Literal* literal) {

Callers

nothing calls this directly

Calls 4

FindInstructionFunction · 0.85
GetLocMethod · 0.80
ErrorFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected