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

Function FixNoMissingArray

tensorflow/lite/toco/tooling_util.cc:969–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967}
968
969void FixNoMissingArray(Model* model) {
970 for (const auto& op : model->operators) {
971 for (const auto& input : op->inputs) {
972 if (!model->HasArray(input) && !model->IsOptionalArray(input)) {
973 model->GetOrCreateArray(input);
974 }
975 }
976 for (const auto& output : op->outputs) {
977 if (!model->HasArray(output) && !model->IsOptionalArray(output)) {
978 model->GetOrCreateArray(output);
979 }
980 }
981 }
982 if (model->flags.allow_nonexistent_arrays()) {
983 for (const string& output_array : model->flags.output_arrays()) {
984 model->GetOrCreateArray(output_array);
985 }
986 for (const auto& rnn_state : model->flags.rnn_states()) {
987 model->GetOrCreateArray(rnn_state.state_array());
988 model->GetOrCreateArray(rnn_state.back_edge_source_array());
989 }
990 }
991}
992
993void CheckNoOrphanedArray(const Model& model) {
994 std::unordered_set<string> arrays_without_known_use;

Callers 1

ImportTensorFlowGraphDefFunction · 0.85

Calls 2

HasArrayMethod · 0.80
IsOptionalArrayMethod · 0.80

Tested by

no test coverage detected