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

Function TEST_F

tensorflow/lite/interpreter_test.cc:930–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

928};
929
930TEST_F(InterpreterTest, GetSetResetExternalContexts) {
931 auto* context = GetInterpreterContext();
932
933 TestExternalContext external_context;
934 external_context.Refresh = [](TfLiteContext* context) {
935 auto* ptr = TestExternalContext::Get(context);
936 if (ptr != nullptr) {
937 ++ptr->num_refreshes;
938 }
939 return kTfLiteOk;
940 };
941
942 EXPECT_EQ(TestExternalContext::Get(context), nullptr);
943 interpreter_.SetNumThreads(4);
944
945 TestExternalContext::Set(context, &external_context);
946 EXPECT_EQ(TestExternalContext::Get(context), &external_context);
947 interpreter_.SetNumThreads(4);
948 interpreter_.SetNumThreads(5);
949 EXPECT_EQ(external_context.num_refreshes, 2);
950
951 TestExternalContext::Set(context, nullptr);
952 EXPECT_EQ(TestExternalContext::Get(context), nullptr);
953 interpreter_.SetNumThreads(4);
954}
955
956// Test fixture that allows playing with execution plans. It creates a two
957// node graph that can be executed in either [0,1] order or [1,0] order.

Callers

nothing calls this directly

Calls 15

GetFunction · 0.85
CreateOperatorCodeDirectFunction · 0.85
CreateOperatorFunction · 0.85
CreateSubGraphFunction · 0.85
CreateModelFunction · 0.85
GetModelFunction · 0.85
InterpreterBuilderClass · 0.85
InvokeClass · 0.85
get_tf_lite_delegateMethod · 0.80
FakeFusedRegistrationMethod · 0.80
CreateVectorMethod · 0.80
SetFunction · 0.50

Tested by

no test coverage detected