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

Function IsValidOpName

tensorflow/core/framework/node_def_util.cc:745–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743using ::tensorflow::strings::Scanner;
744
745bool IsValidOpName(StringPiece sp) {
746 Scanner scanner(sp);
747 scanner.One(Scanner::LETTER_DIGIT_DOT)
748 .Any(Scanner::LETTER_DIGIT_DASH_DOT_SLASH_UNDERSCORE);
749
750 while (true) {
751 if (!scanner.GetResult()) // Some error in previous iteration.
752 return false;
753 if (scanner.empty()) // No error, but nothing left, good.
754 return true;
755
756 // Absorb another piece, starting with a '>'
757 scanner.One(Scanner::RANGLE)
758 .One(Scanner::LETTER_DIGIT_DOT)
759 .Any(Scanner::LETTER_DIGIT_DASH_DOT_SLASH_UNDERSCORE);
760 }
761}
762
763bool IsValidDataInputName(StringPiece sp) {
764 // Data inputs are op_name, op_name:0, or op_name:12345.

Callers 1

ValidateOpNameFunction · 0.85

Calls 3

OneMethod · 0.45
GetResultMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected