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

Function TEST_F

tensorflow/compiler/jit/build_xla_ops_pass_test.cc:132–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132TEST_F(BuildXlaOpsTest, ControlDepsPreserved) {
133 const char* kXlaDeviceName = "/job:worker/replica:0/task:0/device:XLA_CPU:0";
134 Scope root = Scope::NewRootScope().WithDevice(kXlaDeviceName).ExitOnError();
135
136 FunctionDefLibrary fdef_lib =
137 CreateFunctionDefLibWithConstFunction("cluster_0");
138 TF_ASSERT_OK(root.graph()->AddFunctionLibrary(fdef_lib));
139 Node* call;
140 TF_ASSERT_OK(MakeXlaCompiledKernel(root.graph(), "cluster_0", "C", &call));
141 call->set_requested_device(kXlaDeviceName);
142 Node* write_op = MakeWrite(root, "write");
143 root.graph()->AddControlEdge(call, write_op);
144
145 std::unique_ptr<Graph> graph;
146 TF_ASSERT_OK(BuildXlaOps(root, fdef_lib, &graph));
147
148 Node* write_op_new = FindNodeByName(graph.get(), write_op->name());
149 ASSERT_NE(write_op_new, nullptr);
150 EXPECT_THAT(write_op_new, NodeWith(CtrlDeps(NodeWith(Op("_XlaRun")))));
151}
152
153TEST_F(BuildXlaOpsTest, CleanFailureOnBogusAttr) {
154 Scope root = Scope::NewRootScope().ExitOnError();

Callers

nothing calls this directly

Calls 15

MakeXlaCompiledKernelFunction · 0.85
BuildXlaOpsFunction · 0.85
NodeWithFunction · 0.85
CtrlDepsFunction · 0.85
AttrFunction · 0.85
ExitOnErrorMethod · 0.80
set_requested_deviceMethod · 0.80
DoShapeInferenceMethod · 0.80
MakeWriteFunction · 0.70
FindNodeByNameFunction · 0.70
OpFunction · 0.70

Tested by

no test coverage detected