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

Function TEST

tensorflow/lite/kernels/mfcc_test.cc:70–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68};
69
70TEST(MfccOpTest, SimpleTest) {
71 BaseMfccOpModel m({TensorType_FLOAT32, {1, 1, 513}}, {TensorType_INT32, {1}},
72 {TensorType_FLOAT32, {}});
73
74 std::vector<float> data(513);
75 for (int i = 0; i < data.size(); ++i) {
76 data[i] = i + 1;
77 }
78 m.PopulateTensor<float>(m.input1(), 0, data.data(),
79 data.data() + data.size());
80 m.PopulateTensor<int>(m.input2(), {22050});
81
82 m.Invoke();
83
84 std::vector<int> output_shape = m.GetOutputShape();
85 EXPECT_THAT(output_shape, ElementsAre(1, 1, 13));
86 EXPECT_THAT(
87 m.GetOutput(),
88 ElementsAreArray(ArrayFloatNear(
89 {29.13970072, -6.41568601, -0.61903012, -0.96778652, -0.26819878,
90 -0.40907028, -0.15614748, -0.23203119, -0.10481487, -0.1543029,
91 -0.0769791, -0.10806114, -0.06047613},
92 1e-3)));
93}
94
95TEST(MfccOpTest, ScalarInputRateTest) {
96 BaseMfccOpModel m({TensorType_FLOAT32, {1, 1, 513}}, {TensorType_INT32, {}},

Callers

nothing calls this directly

Calls 8

ArrayFloatNearFunction · 0.70
sizeMethod · 0.45
input1Method · 0.45
dataMethod · 0.45
input2Method · 0.45
InvokeMethod · 0.45
GetOutputShapeMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected