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

Function ConsumeNumber

tensorflow/core/util/device_name_utils.cc:78–86  ·  view source on GitHub ↗

Returns true and fills in "*val" iff "*in" starts with a decimal number.

Source from the content-addressed store, hash-verified

76// Returns true and fills in "*val" iff "*in" starts with a decimal
77// number.
78static bool ConsumeNumber(StringPiece* in, int* val) {
79 uint64 tmp;
80 if (str_util::ConsumeLeadingDigits(in, &tmp)) {
81 *val = tmp;
82 return true;
83 } else {
84 return false;
85 }
86}
87
88// Returns a fully qualified device name given the parameters.
89static string DeviceName(const string& job, int replica, int task,

Callers 2

ParseFullNameMethod · 0.85
ParseLocalNameMethod · 0.85

Calls 1

ConsumeLeadingDigitsFunction · 0.85

Tested by

no test coverage detected