Created
December 10, 2015 02:29
-
-
Save kevinrobinson/35d6848f9af97a71f59f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Test that a graph with no constraints will successfully assign nodes to the | |
| // "best available" device (i.e. prefer GPU over CPU). | |
| TEST_F(SimplePlacerTest, TestNoConstraints) { | |
| Graph g(OpRegistry::Global()); | |
| { // Scope for temporary variables used to construct g. | |
| GraphDefBuilder b(GraphDefBuilder::kFailImmediately); | |
| Node* input = ops::SourceOp("TestInput", b.opts().WithName("in")); | |
| ops::UnaryOp("TestRelu", ops::NodeOut(input, 0), b.opts().WithName("n1")); | |
| ops::UnaryOp("TestRelu", ops::NodeOut(input, 1), b.opts().WithName("n2")); | |
| EXPECT_OK(BuildGraph(b, &g)); | |
| } | |
| EXPECT_OK(Place(&g)); | |
| EXPECT_DEVICE_TYPE(g, "in", DEVICE_CPU); | |
| EXPECT_DEVICE_TYPE(g, "n1", DEVICE_GPU); | |
| EXPECT_DEVICE_TYPE(g, "n2", DEVICE_GPU); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment