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

Method ExpectFailure

tensorflow/core/framework/op_kernel_test.cc:178–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176 }
177
178 void ExpectFailure(const string& ascii_node_def, DeviceType device_type,
179 error::Code code) {
180 NodeDef node_def;
181 protobuf::TextFormat::ParseFromString(ascii_node_def, &node_def);
182 Status status;
183 std::unique_ptr<OpKernel> op(
184 CreateOpKernel(std::move(device_type), &device_, cpu_allocator(),
185 node_def, TF_GRAPH_DEF_VERSION, &status));
186 EXPECT_TRUE(op == nullptr);
187 EXPECT_FALSE(status.ok());
188 if (!status.ok()) {
189 LOG(INFO) << "Status message: " << status.error_message();
190 EXPECT_EQ(code, status.code());
191 }
192 }
193
194 private:
195 DeviceBase device_;

Callers

nothing calls this directly

Calls 4

CreateOpKernelFunction · 0.85
cpu_allocatorFunction · 0.85
okMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected