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

Method ParseList

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

Source from the content-addressed store, hash-verified

3519}
3520
3521bool HloParserImpl::ParseList(const TokKind start, const TokKind end,
3522 const TokKind delim,
3523 const std::function<bool()>& parse_and_add_item) {
3524 if (!ParseToken(start, StrCat("expects a list starting with ",
3525 TokKindToString(start)))) {
3526 return false;
3527 }
3528 if (lexer_.GetKind() == end) {
3529 // empty
3530 } else {
3531 do {
3532 if (!parse_and_add_item()) {
3533 return false;
3534 }
3535 } while (EatIfPresent(delim));
3536 }
3537 return ParseToken(
3538 end, StrCat("expects a list to end with ", TokKindToString(end)));
3539}
3540
3541// param_list_to_shape ::= param_list '->' shape
3542bool HloParserImpl::ParseParamListToShape(Shape* shape, LocTy* shape_loc) {

Callers

nothing calls this directly

Calls 3

TokKindToStringFunction · 0.85
GetKindMethod · 0.80
StrCatFunction · 0.50

Tested by

no test coverage detected