pub struct NNAPIExecutionProvider { /* private fields */ }
Implementations§
Source§impl NNAPIExecutionProvider
impl NNAPIExecutionProvider
Sourcepub fn with_fp16(self) -> Self
pub fn with_fp16(self) -> Self
Use fp16 relaxation in NNAPI EP. This may improve performance but can also reduce accuracy due to the lower precision.
Sourcepub fn with_nchw(self) -> Self
pub fn with_nchw(self) -> Self
Use the NCHW layout in NNAPI EP. This is only available for Android API level 29 and higher. Please note that for now, NNAPI might have worse performance using NCHW compared to using NHWC.
Sourcepub fn with_disable_cpu(self) -> Self
pub fn with_disable_cpu(self) -> Self
Prevents NNAPI from using CPU devices. NNAPI is more efficient using GPU or NPU for execution, and NNAPI might fall back to its own CPU implementation for operations not supported by the GPU/NPU. However, the CPU implementation of NNAPI might be less efficient than the optimized versions of operators provided by ORT’s default MLAS execution provider. It might be better to disable the NNAPI CPU fallback and instead use MLAS kernels. This option is only available after Android API level 29.
Sourcepub fn with_cpu_only(self) -> Self
pub fn with_cpu_only(self) -> Self
Using CPU only in NNAPI EP, this may decrease the perf but will provide reference output value without precision loss, which is useful for validation. This option is only available for Android API level 29 and higher, and will be ignored for Android API level 28 and lower.
pub fn build(self) -> ExecutionProviderDispatch
Trait Implementations§
Source§impl Clone for NNAPIExecutionProvider
impl Clone for NNAPIExecutionProvider
Source§fn clone(&self) -> NNAPIExecutionProvider
fn clone(&self) -> NNAPIExecutionProvider
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more