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

Function ParseNodeNameAsStringPiece

tensorflow/core/grappler/utils.h:142–153  ·  view source on GitHub ↗

Returns the node name and position in a single call.

Source from the content-addressed store, hash-verified

140
141// Returns the node name and position in a single call.
142inline StringPiece ParseNodeNameAsStringPiece(absl::string_view name,
143 int* position) {
144 const bool is_control = absl::StartsWith(name, "^");
145 TensorId id = ParseTensorName(name);
146 if (position) {
147 *position = is_control ? -1 : id.second;
148 }
149 if (is_control && id.second >= 0) {
150 id.first.remove_prefix(1);
151 }
152 return id.first;
153}
154
155// Returns the node name and position in a single call.
156inline string ParseNodeName(const string& name, int* position) {

Callers 3

ParseNodeNameFunction · 0.85
NodeNameAsStringPieceFunction · 0.85
NodePositionFunction · 0.85

Calls 2

StartsWithFunction · 0.85
ParseTensorNameFunction · 0.85

Tested by

no test coverage detected