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

Function InitGraph

tensorflow/core/graph/mkl_layout_pass_test.cc:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48const char kGPUDevice[] = "/job:a/replica:0/task:0/device:GPU:0";
49
50static void InitGraph(const string& s, Graph* graph,
51 const string& device = kCPUDevice) {
52 GraphDef graph_def;
53
54 auto parser = protobuf::TextFormat::Parser();
55 // parser.AllowRelaxedWhitespace(true);
56 CHECK(parser.MergeFromString(s, &graph_def)) << s;
57 GraphConstructorOptions opts;
58 TF_CHECK_OK(ConvertGraphDefToGraph(opts, graph_def, graph));
59
60 for (Node* node : graph->nodes()) {
61 node->set_assigned_device_name(device);
62 }
63}
64
65class MklLayoutPassTest : public ::testing::Test {
66 public:

Callers 3

InitGraphMethod · 0.70
TEST_FFunction · 0.70
BM_MklLayoutRewritePassFunction · 0.70

Calls 3

ConvertGraphDefToGraphFunction · 0.85
nodesMethod · 0.45

Tested by

no test coverage detected