本文整理汇总了Python中zmq.pyzmq_version方法的典型用法代码示例。如果您正苦于以下问题:Python zmq.pyzmq_version方法的具体用法?Python zmq.pyzmq_version怎么用?Python zmq.pyzmq_version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zmq
的用法示例。
在下文中一共展示了zmq.pyzmq_version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import zmq [as 别名]
# 或者: from zmq import pyzmq_version [as 别名]
def __init__(self, args):
super().__init__()
self.logger = set_logger(colored('VENTILATOR', 'magenta'), args.verbose)
self.data_dir = args.data_dir
self.num_worker = args.num_worker
self.num_concurrent_socket = max(8, args.num_worker * 2) # optimize concurrency for multi-clients
self.port = args.port
self.args = args
self.status_args = {k: (v if k != 'pooling_strategy' else v.value) for k, v in sorted(vars(args).items())}
self.status_static = {
'python_version': sys.version,
'server_version': __version__,
'pyzmq_version': zmq.pyzmq_version(),
'zmq_version': zmq.zmq_version(),
'server_start_time': str(datetime.now()),
}
self.processes = []
示例2: test_pyzmq_version
# 需要导入模块: import zmq [as 别名]
# 或者: from zmq import pyzmq_version [as 别名]
def test_pyzmq_version(self):
vs = zmq.pyzmq_version()
vs2 = zmq.__version__
self.assertTrue(isinstance(vs, str))
if zmq.__revision__:
self.assertEqual(vs, '@'.join(vs2, zmq.__revision__))
else:
self.assertEqual(vs, vs2)
if version.VERSION_EXTRA:
self.assertTrue(version.VERSION_EXTRA in vs)
self.assertTrue(version.VERSION_EXTRA in vs2)
示例3: __init__
# 需要导入模块: import zmq [as 别名]
# 或者: from zmq import pyzmq_version [as 别名]
def __init__(self, args):
super().__init__()
self.logger = set_logger(colored('VENTILATOR', 'magenta'), args.verbose)
self.model_dir = args.model_dir
self.max_seq_len = args.max_seq_len
self.num_worker = args.num_worker
self.max_batch_size = args.max_batch_size
self.num_concurrent_socket = max(8, args.num_worker * 2) # optimize concurrency for multi-clients
self.port = args.port
self.args = args
self.status_args = {k: (v if k != 'pooling_strategy' else v.value) for k, v in sorted(vars(args).items())}
self.status_static = {
'tensorflow_version': _tf_ver_,
'python_version': sys.version,
'server_version': __version__,
'pyzmq_version': zmq.pyzmq_version(),
'zmq_version': zmq.zmq_version(),
'server_start_time': str(datetime.now()),
}
self.processes = []
self.logger.info('freeze, optimize and export graph, could take a while...')
with Pool(processes=1) as pool:
# optimize the graph, must be done in another process
from .graph import optimize_graph
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
# from .graph import optimize_graph
# self.graph_path = optimize_graph(self.args, self.logger)
if self.graph_path:
self.logger.info('optimized graph is stored at: %s' % self.graph_path)
else:
raise FileNotFoundError('graph optimization fails and returns empty result')
self.is_ready = threading.Event()