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

Method GetKeyAndStepId

tensorflow/contrib/verbs/verbs_util.cc:33–48  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

31
32// static
33void VerbsUtil::GetKeyAndStepId(const string& key_with_step_id, string& key,
34 int64& step_id) {
35 StringPiece s(key_with_step_id);
36 // a key (with step_id) has exact 6 parts if split by ";"
37 // part 1: src_device;
38 // part 2: src_incarnation;
39 // part 3: dst_device;
40 // part 4: name;
41 // part 5: frame_iter.frame_id:frame_iter.iter_id
42 // part 6: step_id
43 std::vector<string> parts = str_util::Split(s, ';');
44 CHECK(parts.size() == 6) << "Key with step_id must have 6 parts";
45 strings::safe_strto64(parts[5], &step_id);
46 parts.pop_back(); // remove step_id
47 key.assign(absl::StrJoin(parts, ";")); // stitch them together
48}
49
50} // namespace tensorflow

Callers

nothing calls this directly

Calls 5

safe_strto64Function · 0.85
pop_backMethod · 0.80
SplitFunction · 0.50
sizeMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected