message: Skip importing IO tensors if custom input_arrays and output_arrays have been provided
diff: @@ -165,8 +165,11 @@ void ImportOperators(
  }
  }
  -void ImportIOTensors(const ::tflite::Model& input_model,
  +void ImportIOTensors(const ModelFlags& model_flags,
  + const ::tflite::Model& input_model,
  const details::TensorsTable& tensors_table, Model* model) {
  + // Import from the first subgraph if input arrays have not been specified.
  + if (model_flags.input_arrays().empty()) {
  auto inputs = (*input_model.subgraphs())[0]->inputs();
  if (inputs) {
  for (int input : *inputs) {
  @@ -174,7 +177,10 @@ void ImportIOTensors(const ::tflite::Model& input_model,
  model->flags.add_input_arrays()->set_name(input_name);
  }
  }
  + }
  + // Import from the first subgraph if output arrays have not been specified.
  + if (model_flags.output_arrays().empty()) {
  auto outputs = (*input_model.subgraphs())[0]->outputs();
  if (outputs) {
  for (int output : *outputs) {
  @@ -183,6 +189,7 @@ void ImportIOTensors(const ::tflite::Model& input_model,
  }
  }
  }
  +}
  namespace {
  bool Verify(const void* buf, size_t len) {
  @@ -219,7 +226,8 @@ std::unique_ptr<Model> Import(const ModelFlags& model_flags,
  ImportTensors(*input_model, model.get());
  ImportOperators(*input_model, ops_by_name, tensors_table, operators_table,
  model.get());
  - ImportIOTensors(*input_model, tensors_table, model.get());
  +
  + ImportIOTensors(model_flags, *input_model, tensors_table, model.get());
  UndoWeightsShuffling(model.get());
  