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

Function CheckOpDeprecation

tensorflow/core/framework/op_def_util.cc:339–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337#undef VALIDATE
338
339Status CheckOpDeprecation(const OpDef& op_def, int graph_def_version) {
340 if (op_def.has_deprecation()) {
341 const OpDeprecation& dep = op_def.deprecation();
342 if (graph_def_version >= dep.version()) {
343 return errors::Unimplemented(
344 "Op ", op_def.name(), " is not available in GraphDef version ",
345 graph_def_version, ". It has been removed in version ", dep.version(),
346 ". ", dep.explanation(), ".");
347 } else {
348 // Warn only once for each op name, and do it in a threadsafe manner.
349 static mutex mu(LINKER_INITIALIZED);
350 static std::unordered_set<string> warned;
351 bool warn;
352 {
353 mutex_lock lock(mu);
354 warn = warned.insert(op_def.name()).second;
355 }
356 if (warn) {
357 LOG(WARNING) << "Op " << op_def.name() << " is deprecated."
358 << " It will cease to work in GraphDef version "
359 << dep.version() << ". " << dep.explanation() << ".";
360 }
361 }
362 }
363 return Status::OK();
364}
365
366namespace {
367

Callers 4

OpKernelMethod · 0.85
FinalizeMethod · 0.85
ValidateGraphDefFunction · 0.85

Calls 4

UnimplementedFunction · 0.85
nameMethod · 0.65
versionMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected