| 672 | } |
| 673 | |
| 674 | TfLiteStatus Subgraph::OpPrepare(const TfLiteRegistration& op_reg, |
| 675 | TfLiteNode* node) { |
| 676 | if (op_reg.prepare == nullptr) { |
| 677 | // Check if it's an unresolved custom op. |
| 678 | if (op_reg.builtin_code == BuiltinOperator_CUSTOM && |
| 679 | op_reg.custom_name != nullptr && op_reg.invoke == &UnresolvedOpInvoke) { |
| 680 | if (IsFlexOp(op_reg.custom_name)) { |
| 681 | ReportError( |
| 682 | "Regular TensorFlow ops are not supported by this interpreter. " |
| 683 | "Make sure you invoke the Flex delegate before inference."); |
| 684 | } else { |
| 685 | ReportError("Encountered unresolved custom op: %s.", |
| 686 | op_reg.custom_name); |
| 687 | } |
| 688 | return kTfLiteError; |
| 689 | } |
| 690 | // Resolved ops can have a null Prepare function. |
| 691 | return kTfLiteOk; |
| 692 | } |
| 693 | return op_reg.prepare(&context_, node); |
| 694 | } |
| 695 | |
| 696 | TfLiteStatus Subgraph::PrepareOpsStartingAt( |
| 697 | int first_execution_plan_index, int* last_execution_plan_index_prepared) { |
nothing calls this directly
no test coverage detected