def initializePaddle(*args): """ To initialize paddle process. :param args: Command line options, such as --use_gpu=0, etc. :return: Nothing. """ old_argv = copy.deepcopy(sys.argv) old_pypath = os.getenv("PYTHONPATH") pypath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) if old_pypath is not None: pypath = os.pathsep.join([pypath, old_pypath]) os.putenv("PYTHONPATH", pypath) args = [""] + list(args) # argv[0] is command name, it is not important. swig_paddle.__initPaddle__(args) sys.argv = old_argv