Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions signal/micro/kernels/stacker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class StackerKernelRunner {
StackerKernelRunner(int* input_dims_data, const int16_t* input_data,
int* output_dims_data, int16_t* output_data,
int* output_ready_dims_data, bool* ouput_ready_data)
: tensors_{testing::CreateTensor(
input_data,
tflite::testing::IntArrayFromInts(input_dims_data)),
testing::CreateTensor(
output_data,
tflite::testing::IntArrayFromInts(output_dims_data)),
testing::CreateTensor(
ouput_ready_data,
testing::IntArrayFromInts(output_ready_dims_data))},
: tensors_{
testing::CreateTensor(
input_data, tflite::testing::IntArrayFromInts(input_dims_data)),
testing::CreateTensor(
output_data,
tflite::testing::IntArrayFromInts(output_dims_data)),
testing::CreateTensor(
ouput_ready_data,
testing::IntArrayFromInts(output_ready_dims_data))},
inputs_array_{testing::IntArrayFromInts(inputs_array_data_)},
outputs_array_{testing::IntArrayFromInts(outputs_array_data_)},
kernel_runner_{*registration_, tensors_, kTensorsSize,
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/compiler/mlir/lite/schema/schema_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace tflite {
// problem. The new builtin operator will be assigned to the extended builtin
// code field in the flatbuffer schema. Those methods helps to hide builtin code
// details.
BuiltinOperator GetBuiltinCode(const OperatorCode *op_code);
BuiltinOperator GetBuiltinCode(const OperatorCode* op_code);

BuiltinOperator GetBuiltinCode(const OperatorCodeT *op_code);
BuiltinOperator GetBuiltinCode(const OperatorCodeT* op_code);

} // namespace tflite

Expand Down
34 changes: 20 additions & 14 deletions tensorflow/lite/experimental/microfrontend/lib/filterbank_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckChannelFrequencyStarts) {
kSampleRate, kSpectrumSize));

const int16_t expected[] = {0, 4, 8};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels + 1,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels + 1,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i <= state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(state.channel_frequency_starts[i], expected[i]);
Expand All @@ -93,8 +94,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckChannelWeightStarts) {
kSampleRate, kSpectrumSize));

const int16_t expected[] = {0, 8, 16};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels + 1,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels + 1,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i <= state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(state.channel_weight_starts[i], expected[i]);
Expand All @@ -110,8 +112,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckChannelWidths) {
kSampleRate, kSpectrumSize));

const int16_t expected[] = {8, 8, 8};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels + 1,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels + 1,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i <= state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(state.channel_widths[i], expected[i]);
Expand All @@ -129,9 +132,10 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckWeights) {
const int16_t expected[] = {0, 3277, 2217, 1200, 222, 0, 0, 0,
0, 3376, 2468, 1591, 744, 0, 0, 0,
0, 4020, 3226, 2456, 1708, 983, 277, 0};
TF_LITE_MICRO_EXPECT_EQ(state.channel_weight_starts[state.num_channels] +
state.channel_widths[state.num_channels],
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.channel_weight_starts[state.num_channels] +
state.channel_widths[state.num_channels],
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
for (size_t i = 0; i < sizeof(expected) / sizeof(expected[0]); ++i) {
TF_LITE_MICRO_EXPECT_EQ(state.weights[i], expected[i]);
}
Expand All @@ -148,9 +152,10 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckUnweights) {
const int16_t expected[] = {0, 819, 1879, 2896, 3874, 0, 0, 0,
0, 720, 1628, 2505, 3352, 0, 0, 0,
0, 76, 870, 1640, 2388, 3113, 3819, 0};
TF_LITE_MICRO_EXPECT_EQ(state.channel_weight_starts[state.num_channels] +
state.channel_widths[state.num_channels],
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.channel_weight_starts[state.num_channels] +
state.channel_widths[state.num_channels],
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
for (size_t i = 0; i < sizeof(expected) / sizeof(expected[0]); ++i) {
TF_LITE_MICRO_EXPECT_EQ(state.unweights[i], expected[i]);
}
Expand Down Expand Up @@ -204,8 +209,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckSqrt) {
uint32_t* scaled_filterbank = FilterbankSqrt(&state, kScaleShift);

const uint32_t expected[] = {247311, 508620};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i < state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(scaled_filterbank[i], expected[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ TF_LITE_MICRO_TEST(NoiseReductionTest_TestNoiseReductionEstimate) {
NoiseReductionApply(&state, signal);

const uint32_t expected[] = {6321887, 31248341};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i < state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(state.estimate[i], expected[i]);
Expand All @@ -68,8 +69,9 @@ TF_LITE_MICRO_TEST(NoiseReductionTest_TestNoiseReduction) {
NoiseReductionApply(&state, signal);

const uint32_t expected[] = {241137, 478104};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i < state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(signal[i], expected[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ TF_LITE_MICRO_TEST(PcanGainControlTest_TestPcanGainControl) {
PcanGainControlApply(&state, signal);

const uint32_t expected[] = {3578, 1533};
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
TF_LITE_MICRO_EXPECT_EQ(
state.num_channels,
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
int i;
for (i = 0; i < state.num_channels; ++i) {
TF_LITE_MICRO_EXPECT_EQ(signal[i], expected[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ inline void ConvPerChannel(
}
}


// Fixed-point per-channel-quantization convolution reference kernel.
// 16-bit data and 8-bit filter
template <typename AccumScalar>
Expand Down
Loading
Loading