Ensure that delegate kernels have valid custom names

PiperOrigin-RevId: 239268129
This commit is contained in:
Jared Duke 2019-03-19 14:20:33 -07:00 committed by TensorFlower Gardener
parent e028703c1c
commit efb872186d
2 changed files with 12 additions and 3 deletions

View File

@ -558,9 +558,16 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
} // namespace kernel } // namespace kernel
TfLiteRegistration GetKernel() { TfLiteRegistration GetKernel() {
TfLiteRegistration registration{&kernel::Init, &kernel::Free, TfLiteRegistration registration{
&kernel::Prepare, &kernel::Eval, &kernel::Init,
nullptr, kTfLiteBuiltinDelegate}; &kernel::Free,
&kernel::Prepare,
&kernel::Eval,
nullptr, // .profiling_string
kTfLiteBuiltinDelegate, // .builtin_code
"TfLiteFlexDelegate", // .custom_name
1, // .version
};
return registration; return registration;
} }

View File

@ -1391,6 +1391,8 @@ TfLiteDelegate* NnApiDelegate() {
.profiling_string = nullptr, .profiling_string = nullptr,
.builtin_code = kTfLiteBuiltinDelegate, .builtin_code = kTfLiteBuiltinDelegate,
.custom_name = "TfLiteNnapiDelegate",
.version = 1,
}; };
// Request TFLite to partition the graph and make kernels // Request TFLite to partition the graph and make kernels