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

Function TEST

tensorflow/lite/kernels/reduce_test.cc:235–245  ·  view source on GitHub ↗

Tests for reduce_mean

Source from the content-addressed store, hash-verified

233
234// Tests for reduce_mean
235TEST(ConstFloatMeanOpTest, NotKeepDims) {
236 std::vector<float> data = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0,
237 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
238 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0};
239 MeanOpConstModel m({TensorType_FLOAT32, {4, 3, 2}}, {TensorType_FLOAT32, {2}},
240 {4}, {1, 0, -3, -3}, false);
241 m.SetInput(data);
242 m.Invoke();
243 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({2}));
244 EXPECT_THAT(m.GetOutput<float>(), ElementsAreArray(ArrayFloatNear({12, 13})));
245}
246
247TEST(ConstFloatMeanOpTest, KeepDims) {
248 std::vector<float> data = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0,

Callers

nothing calls this directly

Calls 8

IsEmptyFunction · 0.85
ArrayFloatNearFunction · 0.70
GetToleranceFunction · 0.70
SetInputMethod · 0.45
InvokeMethod · 0.45
GetOutputShapeMethod · 0.45
InputMethod · 0.45
SetAxisMethod · 0.45

Tested by

no test coverage detected