Enable unsigned quantized infererence using XNNPACK.
PiperOrigin-RevId: 488179656
This commit is contained in:
committed by
Copybara-Service
parent
da36468409
commit
bb6fa85703
@@ -151,6 +151,8 @@ InferenceCalculatorCpuImpl::MaybeCreateDelegate(CalculatorContext* cc) {
|
||||
auto xnnpack_opts = TfLiteXNNPackDelegateOptionsDefault();
|
||||
xnnpack_opts.num_threads =
|
||||
GetXnnpackNumThreads(opts_has_delegate, opts_delegate);
|
||||
// TODO Remove once XNNPACK is enabled by default.
|
||||
xnnpack_opts.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QU8;
|
||||
return TfLiteDelegatePtr(TfLiteXNNPackDelegateCreate(&xnnpack_opts),
|
||||
&TfLiteXNNPackDelegateDelete);
|
||||
}
|
||||
|
||||
@@ -114,6 +114,8 @@ InferenceCalculatorXnnpackImpl::CreateDelegate(CalculatorContext* cc) {
|
||||
auto xnnpack_opts = TfLiteXNNPackDelegateOptionsDefault();
|
||||
xnnpack_opts.num_threads =
|
||||
GetXnnpackNumThreads(opts_has_delegate, opts_delegate);
|
||||
// TODO Remove once XNNPACK is enabled by default.
|
||||
xnnpack_opts.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QU8;
|
||||
return TfLiteDelegatePtr(TfLiteXNNPackDelegateCreate(&xnnpack_opts),
|
||||
&TfLiteXNNPackDelegateDelete);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user