Shortcuts

mmeval.utils.try_import

mmeval.utils.try_import(name: str)Optional[module][source]

Try to import a module.

Parameters

name (str) – Specifies what module to import in absolute or relative terms (e.g. either pkg.mod or ..mod).

Returns

If importing successfully, returns the imported module, otherwise returns None.

Return type

ModuleType or None