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

Function ReadInt64FromEnvVar

tensorflow/core/util/env_var.cc:48–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48Status ReadInt64FromEnvVar(StringPiece env_var_name, int64 default_val,
49 int64* value) {
50 *value = default_val;
51 const char* tf_env_var_val = getenv(string(env_var_name).c_str());
52 if (tf_env_var_val == nullptr) {
53 return Status::OK();
54 }
55 if (strings::safe_strto64(tf_env_var_val, value)) {
56 return Status::OK();
57 }
58 return errors::InvalidArgument(strings::StrCat(
59 "Failed to parse the env-var ${", env_var_name, "} into int64: ",
60 tf_env_var_val, ". Use the default value: ", default_val));
61}
62
63Status ReadStringFromEnvVar(StringPiece env_var_name, StringPiece default_val,
64 string* value) {

Callers 15

CreateMethod · 0.85
GetCoreNumberFunction · 0.85
GetMaxConnectionTimeoutFunction · 0.85
GetMemoryLimitBytesFunction · 0.85
GetCudaContextsCountFunction · 0.85
GpuExecGraphCacheSizeFunction · 0.85
EVAllocatorImplMethod · 0.85
CreateAllocatorMethod · 0.85
EvictionManagerMethod · 0.85
CreateMethod · 0.85
KernelStatsMethod · 0.85

Calls 4

safe_strto64Function · 0.85
InvalidArgumentFunction · 0.85
c_strMethod · 0.80
StrCatFunction · 0.50

Tested by

no test coverage detected