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

Function TEST_F

tensorflow/core/common_runtime/placer_test.cc:397–411  ·  view source on GitHub ↗

Test that a graph with no constraints will successfully assign nodes to the "best available" device (i.e. prefer GPU over CPU).

Source from the content-addressed store, hash-verified

395// Test that a graph with no constraints will successfully assign nodes to the
396// "best available" device (i.e. prefer GPU over CPU).
397TEST_F(PlacerTest, TestNoConstraints) {
398 Graph g(OpRegistry::Global());
399 { // Scope for temporary variables used to construct g.
400 GraphDefBuilder b(GraphDefBuilder::kFailImmediately);
401 Node* input = ops::SourceOp("TestInput", b.opts().WithName("in"));
402 ops::UnaryOp("TestRelu", ops::NodeOut(input, 0), b.opts().WithName("n1"));
403 ops::UnaryOp("TestRelu", ops::NodeOut(input, 1), b.opts().WithName("n2"));
404 TF_EXPECT_OK(BuildGraph(b, &g));
405 }
406
407 TF_EXPECT_OK(Place(&g));
408 EXPECT_DEVICE_TYPE(g, "in", "FakeCPU");
409 EXPECT_DEVICE_TYPE(g, "n1", "FakeGPU");
410 EXPECT_DEVICE_TYPE(g, "n2", "FakeGPU");
411}
412
413// Test that a graph with no constraints but using kernels that have a specified
414// device priority will successfully assign nodes to the device with higher

Callers

nothing calls this directly

Calls 15

SourceOpFunction · 0.85
ResourceOutputFunction · 0.85
GDefFunction · 0.85
NDefFunction · 0.85
ResourceIdentityFunction · 0.85
CPUResourceOutputFunction · 0.85
NestedCPUResourceOutputFunction · 0.85
RecursiveF1Function · 0.85
RecursiveF2Function · 0.85
WithAttrMethod · 0.80

Tested by

no test coverage detected