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

Function TEST_F

tensorflow/c/c_api_experimental_test.cc:273–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271};
272
273TEST_F(AddEagerOpToGraphTest, DebugPrintAndSymbolicExecution) {
274 TFE_TensorHandle* m = TestMatrixTensorHandle();
275 TFE_Op* op = MatMulOp(eager_ctx_, m, m);
276
277 CHECK_EQ(TF_OK, TF_GetCode(status_)) << TF_Message(status_);
278 TFE_OpPrintDebugString(op);
279
280 TFE_TensorHandle* retvals[5];
281 int num_retvals = 5;
282 // Symbolically execute this op, which adds a graph node to `trace_ctx`.
283 TFE_AddEagerOpToGraph(op, trace_ctx_, retvals, &num_retvals, status_);
284 CHECK_EQ(TF_OK, TF_GetCode(status_)) << TF_Message(status_);
285
286 int num_inputs = TFE_FinalizeInputTensorsFromTraceContext(trace_ctx_);
287 CHECK_EQ(num_inputs, 1);
288 auto input_sym_tensor = TFE_GetInputGraphNodeFromTraceContext(trace_ctx_,
289 /*idx*/ 0);
290
291 LOG(INFO) << tensorflow::getTF_OutputDebugString(input_sym_tensor);
292 auto handle = TFE_ConsumeInputConcreteTensorFromTraceContext(trace_ctx_,
293 /*idx*/ 0);
294 TFE_TensorHandlePrintDebugString(handle);
295 TFE_DeleteTensorHandle(handle);
296
297 CHECK_EQ(num_retvals, 1);
298 CHECK_EQ(TFE_TensorHandleDataType(retvals[0]), TF_FLOAT);
299
300 TFE_DeleteTensorHandle(retvals[0]);
301 TFE_DeleteTensorHandle(m);
302 TFE_DeleteOp(op);
303}
304
305TEST_F(AddEagerOpToGraphTest, ValueAttributesArePreserved) {
306 // Create MinOp

Callers

nothing calls this directly

Calls 15

TestMatrixTensorHandleFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
TFE_OpPrintDebugStringFunction · 0.85
TFE_AddEagerOpToGraphFunction · 0.85
TFE_DeleteTensorHandleFunction · 0.85
TFE_TensorHandleDataTypeFunction · 0.85
TFE_DeleteOpFunction · 0.85

Tested by

no test coverage detected