File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed
Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,9 @@ struct TensorData {
8888class SingleOpResolver : public OpResolver {
8989 public:
9090 SingleOpResolver (const BuiltinOperator op, TfLiteRegistration* registration)
91- : op_(op), registration_(registration) {}
91+ : op_(op), registration_(registration) {
92+ registration_->builtin_code = op;
93+ }
9294 TfLiteRegistration* FindOp (BuiltinOperator op) const override {
9395 if (op == op_) {
9496 return registration_;
Original file line number Diff line number Diff line change @@ -191,7 +191,6 @@ TfLiteStatus InterpreterBuilder::BuildLocalIndexToRegistrationMapping() {
191191 builtin_code);
192192 status = kTfLiteError ;
193193 } else if (builtin_code != BuiltinOperator_CUSTOM) {
194- flatbuffer_op_index_to_registration_types_.push_back (builtin_code);
195194 registration = op_resolver_.FindOp (builtin_code);
196195 if (registration == nullptr ) {
197196 error_reporter_->Report (" Didn't find op for builtin opcode '%s'\n " ,
@@ -205,8 +204,6 @@ TfLiteStatus InterpreterBuilder::BuildLocalIndexToRegistrationMapping() {
205204 } else {
206205 const char * name = opcode->custom_code ()->c_str ();
207206 registration = op_resolver_.FindOp (name);
208- flatbuffer_op_index_to_registration_types_.push_back (
209- BuiltinOperator_CUSTOM);
210207 if (registration == nullptr ) {
211208 error_reporter_->Report (" Didn't find custom op for name '%s'\n " , name);
212209 status = kTfLiteError ;
@@ -685,8 +682,7 @@ TfLiteStatus InterpreterBuilder::ParseNodes(
685682 continue ;
686683 }
687684
688- auto op_type =
689- flatbuffer_op_index_to_registration_types_[op->opcode_index ()];
685+ BuiltinOperator op_type = static_cast <BuiltinOperator>(reg->builtin_code );
690686 if (op_type != BuiltinOperator_CUSTOM && op->custom_options ()) {
691687 error_reporter_->Report (
692688 " Found builtin operator %s with custom options.\n " ,
Original file line number Diff line number Diff line change @@ -188,7 +188,6 @@ class InterpreterBuilder {
188188 ErrorReporter* error_reporter_;
189189
190190 std::vector<TfLiteRegistration*> flatbuffer_op_index_to_registration_;
191- std::vector<BuiltinOperator> flatbuffer_op_index_to_registration_types_;
192191 const Allocation* allocation_ = nullptr ;
193192};
194193
You can’t perform that action at this time.
0 commit comments