Internal change.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 16 Apr 2018 22:46:42 +0000 (15:46 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 16 Apr 2018 22:49:28 +0000 (15:49 -0700)
PiperOrigin-RevId: 193112205

tensorflow/contrib/lite/interpreter.cc

index 31b874a..ff8524f 100644 (file)
@@ -245,11 +245,8 @@ TfLiteStatus Interpreter::ReplaceSubgraphsWithDelegateKernels(
         // Initialize the output tensors's delegate-related fields.
         for (int tensor_index : subgraph.output_tensors) {
           TfLiteTensor* tensor = &tensors_[tensor_index];
-          TF_LITE_ENSURE_EQ(&context_, tensor->delegate, nullptr);
-          TF_LITE_ENSURE_EQ(&context_, tensor->buffer_handle,
-                            kTfLiteNullBufferHandle);
-          // buffer_handle will be filled in delegate's `Prepare`
-          // function.
+          TF_LITE_ENSURE(&context_, tensor->delegate == nullptr ||
+                                        tensor->delegate == delegate);
           tensor->delegate = delegate;
         }