Remove kernel selection logic from op resolver. This will be moved into a top level kernel which will delegate to the correct variant. Change-Id: I2d2aab8b8f612afc36dc03d289a6148fbeeb2591
diff --git a/tensorflow/lite/micro/kernels/kelvin/conv.cc b/tensorflow/lite/micro/kernels/kelvin/conv.cc index 03904bc..28ec1e8 100644 --- a/tensorflow/lite/micro/kernels/kelvin/conv.cc +++ b/tensorflow/lite/micro/kernels/kelvin/conv.cc
@@ -91,62 +91,6 @@ break; } case kTfLiteInt64: { - const auto filter_shape = tflite::micro::GetTensorShape(filter); - const auto input_shape = tflite::micro::GetTensorShape(input); - const auto output_shape = tflite::micro::GetTensorShape(output); - if (opt && filter_shape.Dims(kFilterHeightIndex) == 1 && - filter_shape.Dims(kFilterWidthIndex) == 1 && - filter_shape.Dims(kFilterInputChannelIndex) % 32 == 0 && - filter_shape.Dims(kOutputChannelIndex) % 2 == 0) { - kelvin::opt::conv_per_channel_b64_1x1( - params_q, - data.per_channel_output_multiplier, - data.per_channel_output_shift, - tflite::micro::GetTensorShape(input), - tflite::micro::GetTensorData<int16_t>(input), - tflite::micro::GetTensorShape(filter), - tflite::micro::GetTensorData<int8_t>(filter), - tflite::micro::GetTensorShape(bias), - tflite::micro::GetOptionalTensorData<std::int64_t>(bias), - tflite::micro::GetTensorShape(output), - tflite::micro::GetTensorData<int16_t>(output)); - break; - } - // TODO(derekjchow): Check for valid padding - if (opt && filter_shape.Dims(kFilterHeightIndex) == 1 - && filter_shape.Dims(kFilterInputChannelIndex) % 32 == 0 - && filter_shape.Dims(kOutputChannelIndex) % 2 == 0) { - if (input_shape.Dims(kInputChannelIndex) == - filter_shape.Dims(kFilterInputChannelIndex)) { - kelvin::opt::conv_per_channel_b64_filter1xn_non_group( - params_q, - data.per_channel_output_multiplier, - data.per_channel_output_shift, - tflite::micro::GetTensorShape(input), - tflite::micro::GetTensorData<int16_t>(input), - tflite::micro::GetTensorShape(filter), - tflite::micro::GetTensorData<int8_t>(filter), - tflite::micro::GetTensorShape(bias), - tflite::micro::GetOptionalTensorData<std::int64_t>(bias), - tflite::micro::GetTensorShape(output), - tflite::micro::GetTensorData<int16_t>(output)); - break; - } else if (filter_shape.Dims(kFilterInputChannelIndex) % 32 == 0) { - kelvin::opt::conv_per_channel_b64_filter1xn_group( - params_q, - data.per_channel_output_multiplier, - data.per_channel_output_shift, - tflite::micro::GetTensorShape(input), - tflite::micro::GetTensorData<int16_t>(input), - tflite::micro::GetTensorShape(filter), - tflite::micro::GetTensorData<int8_t>(filter), - tflite::micro::GetTensorShape(bias), - tflite::micro::GetOptionalTensorData<std::int64_t>(bias), - tflite::micro::GetTensorShape(output), - tflite::micro::GetTensorData<int16_t>(output)); - break; - } - } const auto fn = opt ? kelvin::opt::conv_per_channel_b64 : reference_integer_ops::ConvPerChannel<int64_t>; fn(