warmup_plugin

lib.infer.plugin_utils.warmup_plugin(plugin: ExtractPlugin, batch_size: int, channels_last: bool | None = None) bool | None

Warm up a plugin that contains torch modules. If channels_last is None then attempt to send a channels first batch through. If it fails, send a channels last batch through

Parameters:
  • plugin (ExtractPlugin) – The plugin to warmup

  • batch_size (int) – The batch size to put through the model

  • channels_last (bool | None) – The expected channel order of the plugin or None to detect

Returns:

True if the plugin is detected as channels last, False for channels first, None for could not be detected

Return type:

bool