aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/interpreter.h
diff options
context:
space:
mode:
authorGravatar Gunhan Gulsoy <gunan@google.com>2018-03-08 00:32:17 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-08 00:36:30 -0800
commite52f916b87557d6b6d28f27f570462debb5ee262 (patch)
tree79657f4d3f9c6978e008b7125ffaf07d6bb7f3ea /tensorflow/contrib/lite/interpreter.h
parent6ff54600831b0af86855b492da938c0ba0e4d910 (diff)
Automated g4 rollback of changelist 188263046
PiperOrigin-RevId: 188293315
Diffstat (limited to 'tensorflow/contrib/lite/interpreter.h')
-rw-r--r--tensorflow/contrib/lite/interpreter.h45
1 files changed, 2 insertions, 43 deletions
diff --git a/tensorflow/contrib/lite/interpreter.h b/tensorflow/contrib/lite/interpreter.h
index f5fcae90cc..04c19644a0 100644
--- a/tensorflow/contrib/lite/interpreter.h
+++ b/tensorflow/contrib/lite/interpreter.h
@@ -265,46 +265,6 @@ class Interpreter {
void set_model(const Model* model) { model_ = const_cast<Model*>(model); }
Model* model() const { return model_; }
- // Ensure the data in `tensor.data` is readable. In case delegate is used,
- // it might require to copy the data from delegate buffer to raw memory.
- TfLiteStatus EnsureTensorDataIsReadable(int tensor_index) {
- TF_LITE_ENSURE(&context_, tensor_index < tensors_size());
- TfLiteTensor* tensor = &tensors_[tensor_index];
- if (tensor->data_is_stale) {
- TF_LITE_ENSURE(&context_, tensor->delegate != nullptr);
- TF_LITE_ENSURE(&context_,
- tensor->delegate_buffer_handle != kTfLiteNullBufferHandle);
- // This can be null if the delegate doesn't use its own buffer.
- TF_LITE_ENSURE(&context_,
- tensor->delegate->CopyFromBufferHandle != nullptr);
- tensor->delegate->CopyFromBufferHandle(tensor->delegate,
- tensor->delegate_buffer_handle,
- tensor->data.raw, tensor->bytes);
- tensor->data_is_stale = false;
- }
- return kTfLiteOk;
- }
-
- // Set the delegate buffer handle to a tensor. It can be called in the
- // following cases:
- // 1. Set the buffer handle to a tensor that's not being written by a
- // delegate. For example, feeding an OpenGL texture as the input of the
- // inference graph.
- // 2. Set the buffer handle to a tensor that uses the same delegate.
- // For example, set an OpenGL texture as the output of inference, while
- // the node which produces output is an OpenGL delegate node.
- // WARNING: This is an experimental API and subject to change.
- TfLiteStatus SetDelegateBufferHandle(
- int tensor_index, TfLiteDelegateBufferHandle delegate_buffer_handle,
- TfLiteDelegate* delegate);
-
- // Get the delegate buffer handle, and the delegate which can process the
- // buffer handle.
- // WARNING: This is an experimental API and subject to change.
- TfLiteStatus GetDelegateBufferHandle(
- int tensor_index, TfLiteDelegateBufferHandle* delegate_buffer_handle,
- TfLiteDelegate** delegate);
-
// The default capacity of `tensors_` vector.
static constexpr int kTensorsReservedCapacity = 128;
// The capacity headroom of `tensors_` vector before calling ops'
@@ -395,15 +355,14 @@ class Interpreter {
// Entry point for C API ReplaceSubgraphsWithDelegateKernels
static TfLiteStatus ReplaceSubgraphsWithDelegateKernels(
TfLiteContext* context, TfLiteRegistration registration,
- const TfLiteIntArray* nodes_to_replace, TfLiteDelegate* delegate);
+ const TfLiteIntArray* nodes_to_replace);
// Update the execution graph to replace some of the nodes with stub
// nodes. Specifically any node index that has `nodes[index]==1` will be
// slated for replacement with a delegate kernel specified by registration.
// WARNING: This is an experimental interface that is subject to change.
TfLiteStatus ReplaceSubgraphsWithDelegateKernels(
- TfLiteRegistration registration, const TfLiteIntArray* nodes_to_replace,
- TfLiteDelegate* delegate);
+ TfLiteRegistration registration, const TfLiteIntArray* nodes_to_replace);
// WARNING: This is an experimental interface that is subject to change.
// Gets the internal pointer to a TensorFlow lite node by node_index.