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

Function TEST_F

tensorflow/lite/delegates/flex/delegate_test.cc:50–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48};
49
50TEST_F(DelegateTest, FullGraph) {
51 // Define the graph.
52 AddTensors(9, {0, 3}, {8}, kTfLiteFloat32, {3});
53
54 AddTfOp(testing::kUnpack, {0}, {1, 2});
55 AddTfOp(testing::kUnpack, {3}, {4, 5});
56 AddTfOp(testing::kAdd, {1, 4}, {6});
57 AddTfOp(testing::kAdd, {2, 5}, {7});
58 AddTfOp(testing::kMul, {6, 7}, {8});
59
60 // Apply the delegate.
61 ConfigureDelegate();
62
63 // Define inputs.
64 SetShape(0, {2, 2, 1});
65 SetValues(0, {1.1f, 2.2f, 3.3f, 4.4f});
66 SetShape(3, {2, 2, 1});
67 SetValues(3, {1.1f, 2.2f, 3.3f, 4.4f});
68
69 ASSERT_TRUE(Invoke());
70
71 ASSERT_THAT(GetShape(8), ElementsAre(2, 1));
72 ASSERT_THAT(GetValues(8), ElementsAre(14.52f, 38.72f));
73 ASSERT_EQ(GetType(8), kTfLiteFloat32);
74}
75
76TEST_F(DelegateTest, NonFloatTypeInference) {
77 AddTensors(3, {0, 1}, {2}, kTfLiteInt32, {2});

Callers

nothing calls this directly

Calls 7

SetValuesFunction · 0.85
InvokeClass · 0.85
GetValuesFunction · 0.85
GetTypeFunction · 0.85
GetShapeFunction · 0.50
swapMethod · 0.45
SetNumThreadsMethod · 0.45

Tested by

no test coverage detected