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

Function TEST

tensorflow/lite/models/smartreply/ops/predict_test.cc:108–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106};
107
108TEST(PredictOpTest, AllLabelsAreValid) {
109 PredictOpModel m({4}, {5}, {5, 2}, 2, 0.0001);
110 m.SetInputSignature({1, 3, 7, 9});
111 m.SetModelKey({1, 2, 4, 6, 7});
112 m.SetModelLabel({11, 12, 11, 12, 11, 12, 11, 12, 11, 12});
113 m.SetModelWeight({0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2});
114 m.Invoke();
115 EXPECT_THAT(m.GetLabel(), ElementsAreArray({12, 11}));
116 EXPECT_THAT(m.GetWeight(), ElementsAreArray(ArrayFloatNear({0.1, 0.05})));
117}
118
119TEST(PredictOpTest, MoreLabelsThanRequired) {
120 PredictOpModel m({4}, {5}, {5, 2}, 1, 0.0001);

Callers

nothing calls this directly

Calls 8

SetInputSignatureMethod · 0.80
SetModelKeyMethod · 0.80
SetModelLabelMethod · 0.80
SetModelWeightMethod · 0.80
GetLabelMethod · 0.80
ArrayFloatNearFunction · 0.50
InvokeMethod · 0.45
GetWeightMethod · 0.45

Tested by

no test coverage detected