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

Function CheckVersions

tensorflow/core/framework/versions.cc:23–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace tensorflow {
22
23Status CheckVersions(const VersionDef& versions, int consumer, int min_producer,
24 const char* upper_name, const char* lower_name) {
25 // Guard against the caller misordering the arguments
26 if (consumer < min_producer) {
27 return errors::Internal(upper_name, " version check has consumer ",
28 consumer, " < min_producer ", min_producer, ".");
29 }
30
31 // Check versions
32 if (versions.producer() < min_producer) {
33 return errors::InvalidArgument(
34 upper_name, " producer version ", versions.producer(),
35 " below min producer ", min_producer, " supported by TensorFlow ",
36 TF_VERSION_STRING, ". Please regenerate your ", lower_name, ".");
37 }
38 if (versions.min_consumer() > consumer) {
39 return errors::InvalidArgument(
40 upper_name, " min consumer version ", versions.min_consumer(),
41 " above current version ", consumer, " for TensorFlow ",
42 TF_VERSION_STRING, ". Please upgrade TensorFlow.");
43 }
44 for (const int bad_consumer : versions.bad_consumers()) {
45 if (bad_consumer == consumer) {
46 return errors::InvalidArgument(
47 upper_name, " disallows consumer version ", bad_consumer,
48 ". Please upgrade TensorFlow: this version is likely buggy.");
49 }
50 }
51
52 // All good!
53 return Status::OK();
54}
55
56} // namespace tensorflow

Callers 3

ConstructMethod · 0.85
LoadShardMethod · 0.85
BundleReaderMethod · 0.85

Calls 2

InternalFunction · 0.85
InvalidArgumentFunction · 0.85

Tested by

no test coverage detected