diplomat.utils.lazy_import.ImportFunctions¶
- class diplomat.utils.lazy_import.ImportFunctions[source]¶
Bases:
object- A set of import functions that can be used by the lazy importer object. Includes the following import functions:
SIMPLE: A basic implementation of an import function.
SILENT: Makes imported package silent by disabling printing and log outputs before importing modules.
ONNX_PRELOAD: Same as simple import, but if importing onnxruntime, also preloads dlls needed by onnxruntime.
- __init__()¶
Methods
ONNX_PRELOAD(name[, pkg])Same as simple import, but if importing onnxruntime, also preloads dlls needed by onnxruntime.
SILENT([pkg])Makes imported package silent by disabling printing and log outputs before importing modules.
SIMPLE([pkg])A basic implementation of an import function.
- ONNX_PRELOAD(name: str, pkg: str | None = None) ModuleType¶
Same as simple import, but if importing onnxruntime, also preloads dlls needed by onnxruntime.
- SILENT(pkg: str | None = None) ModuleType¶
Makes imported package silent by disabling printing and log outputs before importing modules.
- SIMPLE(pkg: str | None = None) ModuleType¶
A basic implementation of an import function.