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

Function TEST_P

tensorflow/core/common_runtime/placer_test.cc:1193–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191}
1192
1193TEST_P(SoftPlacementPlacerTest, TestInvalidMultipleColocationGroups) {
1194 Graph g(OpRegistry::Global());
1195 { // Scope for temporary variables used to construct g.
1196 GraphDefBuilder b(GraphDefBuilder::kFailImmediately);
1197 Node* input = ops::SourceOp("TestInput", b.opts().WithName("in"));
1198 Node* colocated_with_input = ops::UnaryOp(
1199 "ReluCPU", input,
1200 b.opts().WithName("colocated_1").WithAttr("_class", {"loc:@in"}));
1201 Node* colocated_with_input_and_other =
1202 ops::UnaryOp("ReluGPU", input,
1203 b.opts().WithName("foo").WithAttr(
1204 "_class", {"loc:@in", "loc:@colocated_1"}));
1205 CHECK(colocated_with_input);
1206 CHECK(colocated_with_input_and_other);
1207 TF_EXPECT_OK(BuildGraph(b, &g));
1208 }
1209
1210 bool allow_soft_placement = GetParam();
1211 Status s = Place(&g, allow_soft_placement, true);
1212 if (allow_soft_placement) {
1213 EXPECT_EQ(error::OK, s.code()) << s.ToString();
1214 EXPECT_DEVICE_TYPE(g, "in", "FakeCPU");
1215 EXPECT_DEVICE_TYPE(g, "colocated_1", "FakeCPU");
1216 EXPECT_DEVICE_TYPE(g, "foo", "FakeGPU");
1217 } else {
1218 EXPECT_TRUE(absl::StrContains(
1219 s.error_message(),
1220 "Cannot colocate nodes {{colocation_node foo}} and "
1221 "{{colocation_node in}} because no device type supports both of those "
1222 "nodes and the other nodes colocated with them"))
1223 << s.ToString();
1224 }
1225}
1226
1227TEST_F(PlacerTest, TestColocationGroupWithReferenceConnections) {
1228 Graph g(OpRegistry::Global());

Callers

nothing calls this directly

Calls 13

SourceOpFunction · 0.85
GetParamFunction · 0.85
ResourceOutputFunction · 0.85
GDefFunction · 0.85
NDefFunction · 0.85
WithAttrMethod · 0.80
UnaryOpClass · 0.50
StrContainsFunction · 0.50
BinaryOpClass · 0.50
WithNameMethod · 0.45
codeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected