Coverage for mlprodict/npy/xop_auto_import_.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.1.0, created at 2023-02-04 02:28 +0100

1""" 

2@file 

3@brief Xop API. Importing this file takes time. It should be avoided. 

4 

5.. versionadded:: 0.9 

6""" 

7import sys 

8from .xop import _dynamic_class_creation 

9 

10 

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) 

24 

25 

26_update_module()