本文整理匯總了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()