chromium/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc

/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include "tensorflow_lite_support/cc/task/core/tflite_engine.h"

#if defined(OS_POSIX) || defined(OS_FUCHSIA)
#include <unistd.h>
#endif

#include <memory>

#include "absl/strings/match.h"  // from @com_google_absl
#include "absl/strings/str_cat.h"  // from @com_google_absl
#include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/stderr_reporter.h"
#include "tensorflow/lite/tools/verifier.h"
#include "tensorflow_lite_support/cc/common.h"
#include "tensorflow_lite_support/cc/port/configuration_proto_inc.h"
#include "tensorflow_lite_support/cc/port/status_macros.h"
#include "tensorflow_lite_support/cc/task/core/external_file_handler.h"

namespace tflite {
namespace task {
namespace core {

StatusCode;
ComputeSettings;
CreateStatusWithPayload;
InterpreterCreationResources;
TfLiteSupportStatus;

bool TfLiteEngine::Verifier::Verify(const char* data, int length,
                                    tflite::ErrorReporter* reporter) {}

TfLiteEngine::TfLiteEngine(std::unique_ptr<tflite::OpResolver> resolver)
    :{}

std::vector<TfLiteTensor*> TfLiteEngine::GetInputs() {}

std::vector<const TfLiteTensor*> TfLiteEngine::GetOutputs() {}

void TfLiteEngine::VerifyAndBuildModelFromBuffer(
    const char* buffer_data, size_t buffer_size,
    TfLiteVerifier* extra_verifier) {}

absl::Status TfLiteEngine::InitializeFromModelFileHandler(
    const tflite::proto::ComputeSettings& compute_settings) {}

absl::Status TfLiteEngine::BuildModelFromFlatBuffer(
    const char* buffer_data, size_t buffer_size,
    const tflite::proto::ComputeSettings& compute_settings) {}

absl::Status TfLiteEngine::BuildModelFromFile(
    const std::string& file_name,
    const tflite::proto::ComputeSettings& compute_settings) {}

absl::Status TfLiteEngine::BuildModelFromFileDescriptor(
    int file_descriptor,
    const tflite::proto::ComputeSettings& compute_settings) {}

absl::Status TfLiteEngine::BuildModelFromExternalFileProto(
    const ExternalFile* external_file,
    const tflite::proto::ComputeSettings& compute_settings) {}

absl::Status TfLiteEngine::BuildModelFromExternalFileProto(
    std::unique_ptr<ExternalFile> external_file) {}

absl::Status TfLiteEngine::InitInterpreter(int num_threads) {}

// TODO(b/183798104): deprecate num_threads in VK task protos.
// Deprecated. Use the following method, and configure `num_threads` through
// `compute_settings`, i.e. in `CPUSettings`:
// absl::Status TfLiteEngine::InitInterpreter(
//    const tflite::proto::ComputeSettings& compute_settings)
absl::Status TfLiteEngine::InitInterpreter(
    const tflite::proto::ComputeSettings& compute_settings, int num_threads) {}

absl::Status TfLiteEngine::InitInterpreter(
    const tflite::proto::ComputeSettings& compute_settings) {}

}  // namespace core
}  // namespace task
}  // namespace tflite