def caffe2_global_init(logging_print_net_summary=0, num_threads=None):
    if (num_threads is None):
        if (get_num_processes_per_machine() > 1):
            num_threads = 1
        else:
            num_threads = torch.get_num_threads()
    if (not (get_local_rank() == 0)):
        logging_print_net_summary = 0
    from caffe2.python import workspace
    workspace.GlobalInit(['caffe2', '--caffe2_log_level=2', '--caffe2_logging_print_net_summary={}'.format(logging_print_net_summary), '--caffe2_omp_num_threads={}'.format(num_threads), '--caffe2_mkl_num_threads={}'.format(num_threads)])
    logger.info('Using {} threads after GlobalInit'.format(torch.get_num_threads()))
def caffe2_global_init(logging_print_net_summary=0, num_threads=None):
    if (num_threads is None):
        if (get_num_processes_per_machine() > 1):
            num_threads = 1
        else:
            num_threads = torch.get_num_threads()
    if (not (get_local_rank() == 0)):
        logging_print_net_summary = 0
    from caffe2.python import workspace
    workspace.GlobalInit(['caffe2', '--caffe2_log_level=2', '--caffe2_logging_print_net_summary={}'.format(logging_print_net_summary), '--caffe2_omp_num_threads={}'.format(num_threads), '--caffe2_mkl_num_threads={}'.format(num_threads)])
    logger.info('Using {} threads after GlobalInit'.format(torch.get_num_threads()))