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

Function IsTPUGraphDef

tensorflow/core/grappler/utils/tpu.cc:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace grappler {
23
24bool IsTPUGraphDef(const GraphDef& def) {
25 for (const auto& node : def.node()) {
26 if (node.op() == "TPUCompile" || node.op() == "TPUPartitionedCall") {
27 return true;
28 }
29 }
30 if (!def.has_library()) return false;
31 for (const auto& function_def : def.library().function()) {
32 for (const auto& node : function_def.node_def()) {
33 if (node.op() == "TPUCompile" || node.op() == "TPUPartitionedCall") {
34 return true;
35 }
36 }
37 }
38 return false;
39}
40
41} // end namespace grappler
42} // end namespace tensorflow

Callers 3

TEST_FFunction · 0.85
OptimizeMethod · 0.85
OptimizeMethod · 0.85

Calls 5

nodeMethod · 0.45
opMethod · 0.45
functionMethod · 0.45
libraryMethod · 0.45
node_defMethod · 0.45

Tested by 1

TEST_FFunction · 0.68