MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / PrepareOpsStartingAt

Method PrepareOpsStartingAt

tensorflow/lite/core/subgraph.cc:696–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694}
695
696TfLiteStatus Subgraph::PrepareOpsStartingAt(
697 int first_execution_plan_index, int* last_execution_plan_index_prepared) {
698 if (first_execution_plan_index == 0) {
699 has_dynamic_tensors_ = false;
700 }
701 for (int execution_plan_index = first_execution_plan_index;
702 execution_plan_index < execution_plan_.size(); execution_plan_index++) {
703 int node_index = execution_plan_[execution_plan_index];
704 TfLiteNode& node = nodes_and_registration_[node_index].first;
705 const TfLiteRegistration& registration =
706 nodes_and_registration_[node_index].second;
707 EnsureTensorsVectorCapacity();
708 if (OpPrepare(registration, &node) == kTfLiteError) {
709 return ReportOpError(&context_, node, registration, node_index,
710 "failed to prepare");
711 }
712
713 *last_execution_plan_index_prepared = execution_plan_index;
714
715 // Discontinue if the node has dynamic outputs. Note that we don't
716 // stop for dynamic temporary tensors since they won't affect the
717 // sizes of other tensors in the graph.
718 if (HasDynamicTensor(context_, node.outputs)) {
719 has_dynamic_tensors_ = true;
720 return kTfLiteOk;
721 }
722 }
723 return kTfLiteOk;
724}
725
726TfLiteStatus Subgraph::PrepareOpsAndTensors() {
727 if (!memory_planner_) {

Callers

nothing calls this directly

Calls 3

HasDynamicTensorFunction · 0.85
ReportOpErrorFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected