Coverage for onnxcustom/__main__.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.0.5, created at 2023-01-17 01:42 +0100

1# pylint: disable=C0415 

2""" 

3@file 

4@brief Implements command line ``python -m onnxcustom <command> <args>``. 

5""" 

6 

7 

8def main(args, fLOG=print): 

9 """ 

10 Implements ``python -m onnxcustom <command> <args>``. 

11 

12 :param args: command line arguments 

13 :param fLOG: logging function 

14 """ 

15 from pyquickhelper.cli import cli_main_helper 

16 try: 

17 from . import check 

18 from .cli.profiling import nvprof2json 

19 except ImportError: # pragma: no cover 

20 from onnxcustom import check 

21 from onnxcustom.cli.profiling import nvprof2json 

22 

23 fcts = dict(nvprof2json=nvprof2json, check=check) 

24 return cli_main_helper(fcts, args=args, fLOG=fLOG) 

25 

26 

27if __name__ == "__main__": 

28 import sys # pragma: no cover 

29 main(sys.argv[1:]) # pragma: no cover