initializeWith
open override fun initializeWith(vararg executionProviders: ExecutionProvider)
Content copied to clipboard
Initializes the model, if it's not initialized, or re-initializes it, depending on the execution providers.
By default, the model is initialized with CPU execution provider with BFCArena memory allocator. This method allows to set the execution provider to use. If the model is already initialized, internal session will be closed and new one will be created. If executionProvidersInUse is the same as the one passed, nothing will happen. If execution provider is not supported, an exception will be thrown. If empty list is passed, the model will be initialized with CPU execution provider.
Parameters
executionProviders
list of execution providers to use.