Coverage for mlprodict/npy/xop_auto_import_.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2@file
3@brief Xop API. Importing this file takes time. It should be avoided.
5.. versionadded:: 0.9
6"""
7import sys
8from .xop import _dynamic_class_creation
11def _update_module():
12 """
13 Dynamically updates the module with operators defined by *ONNX*.
14 """
15 res = _dynamic_class_creation(include_past=True)
16 this = sys.modules[__name__]
17 unique = set()
18 for cl in res:
19 setattr(this, cl.__name__, cl)
20 unique.add((cl.domain, cl.operator_name))
21 res = _dynamic_class_creation(list(unique))
22 for cl in res:
23 setattr(this, cl.__name__, cl)
26_update_module()