message: Document the side-effect about memory-ownership of the existing GetExecutionPlan method.
diff: @@ -643,6 +643,7 @@ typedef struct TfLiteContext {
  // TfLiteDelegates can traverse the current execution plan by iterating
  // through each member of this array and using GetNodeAndRegistration() to
  // access details about a node. i.e.
  + //
  // TfLiteIntArray* execution_plan;
  // TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context, &execution_plan));
  // for (int exec_index = 0; exec_index < execution_plan->size; exec_index++) {
  @@ -651,6 +652,28 @@ typedef struct TfLiteContext {
  // TfLiteRegistration* reg;
  // context->GetNodeAndRegistration(context, node_index, &node, &reg);
  // }
  + // Note: the memory pointed by '`*execution_plan` is OWNED by TfLite runtime.
  + // Future calls to GetExecutionPlan invalidates earlier outputs. The following
  + // code snippet shows the issue of such an invocation pattern. After calling
  + // CheckNode, subsequent access to `plan_1st` is undefined.
  + //
  + // void CheckNode(const TfLiteNode* node) {
  + // ...
  + // TfLiteIntArray* plan_2nd;
  + // TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context, &plan_2nd));
  + // ...
  + // }
  + //
  + // TfLiteIntArray* plan_1st;
  + // TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context, &plan_1st));
  + // for (int exec_index = 0; exec_index < plan_1st->size; exec_index++) {
  + // int node_index = plan_1st->data[exec_index];
  + // TfLiteNode* node;
  + // TfLiteRegistration* reg;
  + // context->GetNodeAndRegistration(context, node_index, &node, &reg);
  + // CheckNode(node);
  + // }
  + //
  // WARNING: This is an experimental interface that is subject to change.
  TfLiteStatus (*GetExecutionPlan)(struct TfLiteContext* context,
  TfLiteIntArray** execution_plan);
  