File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 33//
44#include " ModelBuilder.h"
55
6- #include < sys/mman.h >
6+ #include < algorithm >
77#include < array>
88#include < ctime>
99#include < fstream>
1010#include < iostream>
1111#include < sstream>
12+ #include < sys/mman.h>
1213#include < tuple>
1314
1415#include < common/helper.h>
@@ -761,6 +762,17 @@ ModelBuilder::Index ModelBuilder::AddTensorFromBuffer(
761762}
762763
763764std::unique_ptr<Model> ModelBuilder::Compile (uint32_t preference) {
765+ if (output_index_vec_.empty ()) {
766+ std::set<std::string> outputs;
767+ std::set_difference (imm_blob_outputs_.begin (), imm_blob_outputs_.end (),
768+ imm_blob_inputs_.begin (), imm_blob_inputs_.end (),
769+ std::inserter (outputs, outputs.end ()));
770+ for (const auto &output : outputs) {
771+ VLOG (3 ) << " No output set explicitly, automatically add " + output +
772+ " as an output.." ;
773+ AddOutput (output);
774+ }
775+ }
764776 THROW_ON_ERROR_WITH_NOTE (
765777 ANeuralNetworksModel_identifyInputsAndOutputs (
766778 dnn_model_->model_ , static_cast <uint32_t >(input_index_vec_.size ()),
You can’t perform that action at this time.
0 commit comments