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

Function TEST

tensorflow/lite/interpreter_test.cc:64–86  ·  view source on GitHub ↗

Make an interpreter that has no tensors and no nodes

Source from the content-addressed store, hash-verified

62
63// Make an interpreter that has no tensors and no nodes
64TEST(BasicInterpreter, ZeroInterpreter) {
65 testing::internal::CaptureStderr();
66
67 Interpreter interpreter;
68
69#ifndef NDEBUG
70 const char* kExpectedLog = "INFO: Initialized TensorFlow Lite runtime";
71#else
72 const char* kExpectedLog = "";
73#endif
74 EXPECT_THAT(testing::internal::GetCapturedStderr(),
75 testing::HasSubstr(kExpectedLog));
76
77 interpreter.SetInputs({});
78 interpreter.SetOutputs({});
79 ASSERT_EQ(interpreter.AllocateTensors(), kTfLiteOk);
80 ASSERT_EQ(interpreter.Invoke(), kTfLiteOk);
81
82 // Creating a new interpreter should not redundantly log runtime init.
83 testing::internal::CaptureStderr();
84 Interpreter interpreter2;
85 EXPECT_THAT(testing::internal::GetCapturedStderr(), IsEmpty());
86}
87
88// Test various error conditions.
89TEST(BasicInterpreter, InvokeInvalidModel) {

Callers

nothing calls this directly

Calls 15

CaptureStderrClass · 0.85
IsEmptyFunction · 0.85
TfLiteFloatArrayCreateFunction · 0.85
TfLiteIntArrayCreateFunction · 0.85
TfLiteTensorReallocFunction · 0.85
TfLiteIntArrayCopyFunction · 0.85
TfLiteIntArrayFreeFunction · 0.85
GetStringFunction · 0.85
Register_PADV2Function · 0.85
ResizeTensorMethod · 0.80
AddStringMethod · 0.80
WriteToTensorAsVectorMethod · 0.80

Tested by

no test coverage detected