#include "tensorflow/lite/core/async/async_signature_runner.h"
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "tensorflow/lite/core/async/async_kernel_internal.h"
#include "tensorflow/lite/core/async/async_subgraph.h"
#include "tensorflow/lite/core/async/c/types.h"
#include "tensorflow/lite/core/async/task_internal.h"
#include "tensorflow/lite/core/c/c_api_types.h"
#include "tensorflow/lite/core/subgraph.h"
namespace tflite {
namespace async {
namespace {
int GetIndex(const std::map<std::string, uint32_t>* map, const char* name) { … }
}
int AsyncSignatureRunner::GetTensorIndex(TfLiteIoType io_type,
const char* name) const { … }
AsyncSignatureRunner::AsyncSignatureRunner(
const internal::SignatureDef* signature_def, Subgraph* subgraph)
: … { … }
TfLiteStatus AsyncSignatureRunner::RegisterBuffer(
TfLiteIoType io_type, const TfLiteBackendBuffer* buffer,
const TfLiteAttributeMap* attrs, TfLiteBufferHandle* handle) { … }
TfLiteStatus AsyncSignatureRunner::RegisterBufferSlice(
TfLiteBufferHandle buffer_pool, const TfLiteAttributeMap* attrs,
TfLiteBufferHandle* handle) { … }
TfLiteStatus AsyncSignatureRunner::UnregisterBuffer(TfLiteBufferHandle handle) { … }
const std::vector<const char*>& AsyncSignatureRunner::SupportedBufferTypes(
TfLiteIoType io_type) const { … }
const std::vector<const char*>& AsyncSignatureRunner::SupportedSynchronizations(
TfLiteIoType io_type) const { … }
bool AsyncSignatureRunner::ReconcileRestrictions(
TfLiteIoType io_type, const char* name,
const TfLiteAttributeMap* user_provided_attributes,
TfLiteAttributeMap* merged, TfLiteAttributeMap* conflict) const { … }
bool AsyncSignatureRunner::ReconcileRestrictions(
int tensor_index, const TfLiteAttributeMap* user_provided_attributes,
TfLiteAttributeMap* merged, TfLiteAttributeMap* conflict) const { … }
TfLiteStatus AsyncSignatureRunner::SetAttributes(
TfLiteIoType io_type, const char* name, const TfLiteAttributeMap* attrs) { … }
TfLiteStatus AsyncSignatureRunner::SetAttributes(
int tensor_index, const TfLiteAttributeMap* attrs) { … }
TfLiteStatus AsyncSignatureRunner::SetBufferAttributes(
const TfLiteBackendBuffer* buffer, const TfLiteAttributeMap* attrs) { … }
TfLiteStatus AsyncSignatureRunner::GetBufferAttributes(
const TfLiteBackendBuffer* buffer, TfLiteAttributeMap* attrs) { … }
TfLiteStatus AsyncSignatureRunner::PrepareBackends() { … }
TfLiteExecutionTask* AsyncSignatureRunner::CreateTask() { … }
TfLiteStatus AsyncSignatureRunner::InvokeAsync(TfLiteExecutionTask* task) { … }
TfLiteStatus AsyncSignatureRunner::Wait(TfLiteExecutionTask* task) { … }
TfLiteStatus AsyncSignatureRunner::Finish(TfLiteExecutionTask* task) { … }
const TfLiteOpaqueTensor* AsyncSignatureRunner::input_tensor(
const char* input_name) const { … }
const TfLiteOpaqueTensor* AsyncSignatureRunner::output_tensor(
const char* output_name) const { … }
}
}